From 808cfc67a7b6bfdaf1b739ddee795d9400bf5ba5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A6=BA=E7=8B=A8?= <18119604035@163.com> Date: Fri, 31 Mar 2023 09:48:13 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=86=E9=A2=91=E6=92=AD=E6=94=BE=E8=BF=9E?= =?UTF-8?q?=E7=BB=AD=E8=B7=B3=E8=BD=AC=E4=B8=8B=E4=B8=80=E8=8A=82=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/course/compenents/hour.tsx | 2 +- src/pages/course/compenents/video.tsx | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/pages/course/compenents/hour.tsx b/src/pages/course/compenents/hour.tsx index 9af7790..c8f517c 100644 --- a/src/pages/course/compenents/hour.tsx +++ b/src/pages/course/compenents/hour.tsx @@ -49,7 +49,7 @@ export const HourCompenent: React.FC = ({ }; const goNextVideo = () => { - const index = totalHours.findIndex((i: any) => i.id === id); + const index = totalHours.findIndex((i: any) => i.id === currentId); if (index === totalHours.length - 1) { setIsLastpage(true); } else if (index < totalHours.length - 1) { diff --git a/src/pages/course/compenents/video.tsx b/src/pages/course/compenents/video.tsx index 9f37261..d4f655b 100644 --- a/src/pages/course/compenents/video.tsx +++ b/src/pages/course/compenents/video.tsx @@ -35,6 +35,7 @@ export const VideoModel: React.FC = ({ const [playDuration, setPlayDuration] = useState(0); const [playendedStatus, setPlayendedStatus] = useState(false); const [lastSeeValue, setLastSeeValue] = useState({}); + const [loading, setLoading] = useState(false); const myRef = useRef(0); useEffect(() => { @@ -94,6 +95,7 @@ export const VideoModel: React.FC = ({ playTimeUpdate(parseInt(window.player.video.currentTime), true); window.player && window.player.destroy(); }); + setLoading(false); }; const playTimeUpdate = (duration: number, isEnd: boolean) => { @@ -143,6 +145,10 @@ export const VideoModel: React.FC = ({
{ + if (loading) { + return; + } + setLoading(true); setLastSeeValue({}); setPlayendedStatus(false); goNextVideo();