修复重启后歌词快进不生效的问题
This commit is contained in:
@@ -9,6 +9,7 @@ export const init = () => {
|
||||
lrc = new Lyric({
|
||||
shadowContent: true,
|
||||
activeLineClassName: 'active',
|
||||
rate: setting['player.playbackRate'],
|
||||
isVertical: setting['desktopLyric.direction'] == 'vertical',
|
||||
onPlay(line, text) {
|
||||
setText(text, line)
|
||||
|
||||
@@ -41,7 +41,6 @@ const handleDesktopLyricMessage = (event: LX.DesktopLyric.LyricActions) => {
|
||||
break
|
||||
case 'set_status':
|
||||
setIsPlay(event.data.isPlay)
|
||||
setPlaybackRate(event.data.rate)
|
||||
if (event.data.isPlay) play(event.data.played_time)
|
||||
else pause()
|
||||
break
|
||||
|
||||
@@ -34,6 +34,7 @@ export const setting = shallowReactive<LX.DesktopLyric.Config>({
|
||||
'player.isShowLyricTranslation': false,
|
||||
'player.isShowLyricRoma': false,
|
||||
'player.isPlayLxlrc': false,
|
||||
'player.playbackRate': 1,
|
||||
})
|
||||
|
||||
// export const themeList = markRaw([
|
||||
|
||||
@@ -1,11 +1,20 @@
|
||||
import { watch } from '@common/utils/vueTools'
|
||||
import { setLyric, setVertical } from '@lyric/core/lyric'
|
||||
import { setting } from '@lyric/store/state'
|
||||
import { setLyric, setVertical, setPlaybackRate } from '@lyric/core/lyric'
|
||||
import { getStatus } from '@lyric/core/mainWindowChannel'
|
||||
import { isPlay, setting } from '@lyric/store/state'
|
||||
|
||||
export default () => {
|
||||
watch(() => setting['player.isShowLyricTranslation'], setLyric)
|
||||
watch(() => setting['player.isShowLyricRoma'], setLyric)
|
||||
watch(() => setting['player.isPlayLxlrc'], setLyric)
|
||||
watch(() => setting['player.playbackRate'], (rate) => {
|
||||
setPlaybackRate(rate)
|
||||
if (isPlay.value) {
|
||||
setTimeout(() => {
|
||||
getStatus()
|
||||
})
|
||||
}
|
||||
})
|
||||
watch(() => setting['desktopLyric.direction'], (direction) => {
|
||||
setVertical(direction == 'vertical')
|
||||
// if (isPlay.value)
|
||||
|
||||
Reference in New Issue
Block a user