From 7ed91c07773abcf9d4eabb4b764b75b1f6a0c7b8 Mon Sep 17 00:00:00 2001 From: harry Date: Wed, 18 Mar 2020 22:07:47 +0800 Subject: [PATCH] fix --- .../src/modules/courses/Video/video-play/index.jsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/public/react/src/modules/courses/Video/video-play/index.jsx b/public/react/src/modules/courses/Video/video-play/index.jsx index 817857eac..bfa56c938 100644 --- a/public/react/src/modules/courses/Video/video-play/index.jsx +++ b/public/react/src/modules/courses/Video/video-play/index.jsx @@ -113,17 +113,14 @@ export default ({ src, videoId, logWatchHistory, courseId = null }) => { log() } } - + //循环播放, 累计时长不能清空 async function onEnded() { log(() => { logId = null - logCount = 1 lastUpdatedTime = 0 - sumTimePlayed = 0 initLog = false isLoging = false isSeeking = false - pos = [] }, true) } @@ -142,6 +139,8 @@ export default ({ src, videoId, logWatchHistory, courseId = null }) => { log() } } + } else { + lastUpdatedTime = newTime } } @@ -180,6 +179,9 @@ export default ({ src, videoId, logWatchHistory, courseId = null }) => { el.current.removeEventListener('seeking', onSeeking) el.current.removeEventListener('seeked', onSeeked) el.current.removeEventListener('timeupdate', onTimeupdate) + if (el.current.playing) { + log() + } } }, [el, src])