|
|
|
@ -44,7 +44,9 @@ export default ({ src, videoId, logWatchHistory, courseId = null }) => {
|
|
|
|
|
let pos = []//播放时间点集
|
|
|
|
|
|
|
|
|
|
const log = useCallback((callback, isEnd = false) => {
|
|
|
|
|
let params = {}
|
|
|
|
|
let params = {
|
|
|
|
|
point: el.currentTime.currentTime
|
|
|
|
|
}
|
|
|
|
|
if (logId) {
|
|
|
|
|
params['log_id'] = logId
|
|
|
|
|
params['watch_duration'] = getTotalEffectTime(pos) //当前观看视频时长,拖放进度条,重复的视频片段观看时,不会把重复的时长累积进来,最大时长是视频的总时长
|
|
|
|
@ -137,7 +139,7 @@ export default ({ src, videoId, logWatchHistory, courseId = null }) => {
|
|
|
|
|
log()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}else {
|
|
|
|
|
} else {
|
|
|
|
|
lastUpdatedTime = newTime
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -177,7 +179,7 @@ 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) {
|
|
|
|
|
if (el.current.playing) {
|
|
|
|
|
log()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|