diff --git a/src/app.ts b/src/app.ts new file mode 100644 index 0000000..9a93c26 --- /dev/null +++ b/src/app.ts @@ -0,0 +1,4 @@ +import { useVideo } from '@/core/useVideo'; +import JoLPlayer from '@/core/index'; +export { useVideo }; +export default JoLPlayer; diff --git a/src/appComponent.tsx b/src/appComponent.tsx index 6803f2f..f27f088 100644 --- a/src/appComponent.tsx +++ b/src/appComponent.tsx @@ -1,7 +1,6 @@ import React, { memo, useRef, useEffect } from 'react'; -import JoLPlayer from '@/core/index'; +import JoLPlayer, { useVideo } from './app'; import '@/icons/'; -import { useVideo } from '@/core/useVideo'; const AppComponent = memo(function AppComponent(props) { const videoRef = useRef(null!); @@ -18,7 +17,7 @@ const AppComponent = memo(function AppComponent(props) { // console.log(val, xx.current); // }, onTimeChange: (val: any) => { - // console.log(val); + console.log(val); }, // onEndEd: (val: any) => { // console.log('结束', val); diff --git a/src/core/controller/index.tsx b/src/core/controller/index.tsx index 74d81cc..f5517f8 100644 --- a/src/core/controller/index.tsx +++ b/src/core/controller/index.tsx @@ -17,12 +17,12 @@ const Index = memo(function Index(props) { const { isPlay, handleChangePlayState, currentTime } = useVideo({ videoElement: reviceProps.videoRef, - onPause: (val: any) => { - console.log(val); - }, - onPlay: (val: any) => { - console.log(val); - }, + // onPause: (val: any) => { + // console.log(val); + // }, + // onPlay: (val: any) => { + // console.log(val); + // }, // onTimeChange: (val: any) => { // console.log(val); // },