master
lgf 3 years ago
parent 7ca6fd873c
commit 287fb81342
  1. 4
      src/app.ts
  2. 5
      src/appComponent.tsx
  3. 12
      src/core/controller/index.tsx

@ -0,0 +1,4 @@
import { useVideo } from '@/core/useVideo';
import JoLPlayer from '@/core/index';
export { useVideo };
export default JoLPlayer;

@ -1,7 +1,6 @@
import React, { memo, useRef, useEffect } from 'react'; import React, { memo, useRef, useEffect } from 'react';
import JoLPlayer from '@/core/index'; import JoLPlayer, { useVideo } from './app';
import '@/icons/'; import '@/icons/';
import { useVideo } from '@/core/useVideo';
const AppComponent = memo(function AppComponent(props) { const AppComponent = memo(function AppComponent(props) {
const videoRef = useRef<HTMLVideoElement>(null!); const videoRef = useRef<HTMLVideoElement>(null!);
@ -18,7 +17,7 @@ const AppComponent = memo(function AppComponent(props) {
// console.log(val, xx.current); // console.log(val, xx.current);
// }, // },
onTimeChange: (val: any) => { onTimeChange: (val: any) => {
// console.log(val); console.log(val);
}, },
// onEndEd: (val: any) => { // onEndEd: (val: any) => {
// console.log('结束', val); // console.log('结束', val);

@ -17,12 +17,12 @@ const Index = memo(function Index(props) {
const { isPlay, handleChangePlayState, currentTime } = useVideo({ const { isPlay, handleChangePlayState, currentTime } = useVideo({
videoElement: reviceProps.videoRef, videoElement: reviceProps.videoRef,
onPause: (val: any) => { // onPause: (val: any) => {
console.log(val); // console.log(val);
}, // },
onPlay: (val: any) => { // onPlay: (val: any) => {
console.log(val); // console.log(val);
}, // },
// onTimeChange: (val: any) => { // onTimeChange: (val: any) => {
// console.log(val); // console.log(val);
// }, // },

Loading…
Cancel
Save