We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b13e8dd commit 95b7346Copy full SHA for 95b7346
packages/xgplayer/src/plugins/danmu/index.js
@@ -117,15 +117,16 @@ class Danmu extends Plugin {
117
this.intervalId = null
118
}
119
const now = window.performance.now()
120
- if (now - this.seekCost > MIN_INTERVAL) {
+ const delayTime = now - this.seekCost > MIN_INTERVAL ? 100 : MIN_INTERVAL
121
+
122
+ this.intervalId = Util.setTimeout(this, () => {
123
this.danmujs.start()
- } else {
- this.intervalId = Util.setTimeout(this, () => {
124
- this.danmujs.start()
125
- // clearTimeout(this.intervalId)
126
- this.intervalId = null
127
- }, MIN_INTERVAL)
128
- }
+ this.intervalId = null
+ if (this.player.paused) {
+ this.danmujs.pause()
+ }
129
+ }, delayTime)
130
})
131
132
0 commit comments