修复界面不可见时状态栏歌词没有更新的问题
This commit is contained in:
@@ -228,7 +228,7 @@ export default class Lyric {
|
||||
} else this.playingLineNum = 0
|
||||
}
|
||||
|
||||
setAutoPause(autoPause) {
|
||||
this.linePlayer.setAutoPause(autoPause)
|
||||
setDisabledAutoPause(autoPause) {
|
||||
this.linePlayer.setDisabledAutoPause(autoPause)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -225,15 +225,15 @@ export default class LinePlayer {
|
||||
this._init()
|
||||
}
|
||||
|
||||
setAutoPause(autoPause) {
|
||||
if (autoPause) {
|
||||
timeoutTools.nextTick = window.requestAnimationFrame.bind(window)
|
||||
timeoutTools.cancelNextTick = window.cancelAnimationFrame.bind(window)
|
||||
} else {
|
||||
setDisabledAutoPause(disabledAutoPause) {
|
||||
if (disabledAutoPause) {
|
||||
timeoutTools.nextTick = (handler) => {
|
||||
return setTimeout(handler, 20)
|
||||
}
|
||||
timeoutTools.cancelNextTick = clearTimeout.bind(global)
|
||||
} else {
|
||||
timeoutTools.nextTick = window.requestAnimationFrame.bind(window)
|
||||
timeoutTools.cancelNextTick = window.cancelAnimationFrame.bind(window)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user