video-player add point

courseware
harry 5 years ago
parent 9c52a0a135
commit 48b9fa5197

@ -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()
}
}

Loading…
Cancel
Save