mirror of
https://github.com/bytedance/xgplayer.git
synced 2025-04-05 03:05:02 +08:00
fix: 🐛 (xgplayer) 修复播放器seeked时,播放器未启动播放而弹幕自动播放问题
This commit is contained in:
parent
b13e8dd596
commit
95b73461e1
@ -117,15 +117,16 @@ class Danmu extends Plugin {
|
||||
this.intervalId = null
|
||||
}
|
||||
const now = window.performance.now()
|
||||
if (now - this.seekCost > MIN_INTERVAL) {
|
||||
const delayTime = now - this.seekCost > MIN_INTERVAL ? 100 : MIN_INTERVAL
|
||||
|
||||
this.intervalId = Util.setTimeout(this, () => {
|
||||
this.danmujs.start()
|
||||
} else {
|
||||
this.intervalId = Util.setTimeout(this, () => {
|
||||
this.danmujs.start()
|
||||
// clearTimeout(this.intervalId)
|
||||
this.intervalId = null
|
||||
}, MIN_INTERVAL)
|
||||
}
|
||||
this.intervalId = null
|
||||
|
||||
if (this.player.paused) {
|
||||
this.danmujs.pause()
|
||||
}
|
||||
}, delayTime)
|
||||
})
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user