通过歌词调整进度时添加对偏移时间的计算

This commit is contained in:
lyswhut
2022-03-23 17:49:34 +08:00
parent e0e65e4374
commit 469832a598
4 changed files with 12 additions and 7 deletions
+1 -1
View File
@@ -28,7 +28,7 @@ export default ({ isPlay, lyric }) => {
if (time == -1) return
handleSkipMouseLeave()
isStopScroll.value = false
window.eventHub.emit(eventPlayerNames.setProgress, time)
window.eventHub.emit(eventPlayerNames.setProgress, Math.max(time + lyric.offset + lyric.tempOffset, 0))
if (!isPlay.value) window.eventHub.emit(eventPlayerNames.setPlay)
}
const handleSkipMouseEnter = () => {
@@ -34,7 +34,7 @@ module.exports = class LinePlayer {
if (this.translationLyric == null) this.translationLyric = ''
this._initTag()
this._initLines()
this.onSetLyric(this.lines)
this.onSetLyric(this.lines, this.tags.offset + this.offset)
}
_initTag() {