From 97f4abfe412624ff7db33f39b073764db1cc6763 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A6=BA=E7=8B=A8?= <18119604035@163.com> Date: Tue, 30 May 2023 18:13:10 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=86=E9=A2=91=E5=B7=B2=E5=AD=A6=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E8=BF=9B=E5=BA=A6=E6=9D=A1b?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/course/video.tsx | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/pages/course/video.tsx b/src/pages/course/video.tsx index 49416fc..4abf5fe 100644 --- a/src/pages/course/video.tsx +++ b/src/pages/course/video.tsx @@ -129,7 +129,9 @@ const CoursePalyPage = () => { const initDPlayer = (playUrl: string, isTrySee: number, params: any) => { let banDrag = - systemConfig.playerIsDisabledDrag && watchRef.current < totalRef.current; + systemConfig.playerIsDisabledDrag && + watchRef.current < totalRef.current && + watchRef.current === 0; window.player = new window.DPlayer({ container: document.getElementById("meedu-player-container"), autoplay: false, @@ -155,7 +157,8 @@ const CoursePalyPage = () => { window.player.on("timeupdate", () => { let currentTime = parseInt(window.player.video.currentTime); if ( - banDrag && + systemConfig.playerIsDisabledDrag && + watchRef.current < totalRef.current && currentTime - playRef.current >= 2 && currentTime > watchRef.current ) { @@ -166,7 +169,11 @@ const CoursePalyPage = () => { } }); window.player.on("ended", () => { - if (banDrag && window.player.video.duration - playRef.current >= 2) { + if ( + systemConfig.playerIsDisabledDrag && + watchRef.current < totalRef.current && + window.player.video.duration - playRef.current >= 2 + ) { window.player.seek(playRef.current); return; }