优化进度条逻辑

This commit is contained in:
lyswhut
2021-11-28 00:15:51 +08:00
parent cffa74b1c2
commit 63141c4ac9
3 changed files with 9 additions and 22 deletions
@@ -208,6 +208,7 @@ module.exports = class FontPlayer {
if (this.delay > 0) {
this._handlePlayFont(curFont, driftTime)
this.timeoutTools.start(() => {
if (!this.isPlay) return
this._refresh()
}, this.delay)
return
@@ -215,6 +216,7 @@ module.exports = class FontPlayer {
} else if (this.curFontNum == 0) {
this.curFontNum--
this.waitPlayTimeout.start(() => {
if (!this.isPlay) return
this._refresh()
}, -driftTime)
return
@@ -125,6 +125,7 @@ module.exports = class LinePlayer {
this.isOffseted = true
}
timeoutTools.start(() => {
if (!this.isPlay) return
this._refresh()
}, this.delay)
this.onPlay(this.curLineNum, curLine.text, currentTime)