|
|
|
@ -43,7 +43,7 @@ export default ({ src, videoId, logWatchHistory, courseId = null }) => {
|
|
|
|
|
let isSeeking = false
|
|
|
|
|
let pos = []//播放时间点集
|
|
|
|
|
|
|
|
|
|
const log = useCallback((callback) => {
|
|
|
|
|
const log = useCallback((callback, isEnd = false) => {
|
|
|
|
|
let params = {}
|
|
|
|
|
if (logId) {
|
|
|
|
|
params['log_id'] = logId
|
|
|
|
@ -59,6 +59,9 @@ export default ({ src, videoId, logWatchHistory, courseId = null }) => {
|
|
|
|
|
params['duration'] = totalDuration
|
|
|
|
|
params['device'] = device
|
|
|
|
|
}
|
|
|
|
|
if (isEnd) {
|
|
|
|
|
params['ed'] = "1"
|
|
|
|
|
}
|
|
|
|
|
async function getLogId() {
|
|
|
|
|
isLoging = true
|
|
|
|
|
let id = await logWatchHistory(params)
|
|
|
|
@ -119,7 +122,7 @@ export default ({ src, videoId, logWatchHistory, courseId = null }) => {
|
|
|
|
|
isLoging = false
|
|
|
|
|
isSeeking = false
|
|
|
|
|
pos = []
|
|
|
|
|
})
|
|
|
|
|
}, true)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function onTimeupdate() {
|
|
|
|
|