fix(Player): 修复播放状态未正确更新的问题

在播放下一首或上一首时,直接调用 `player.value?.play()` 可能会导致播放状态未正确更新。通过设置 `playQueueStore.isPlaying = true` 来确保播放状态同步更新。
This commit is contained in:
Astrian Zheng 2025-05-25 09:11:06 +10:00
parent 3d47a6a774
commit 8c1957c6ee
Signed by: Astrian
SSH Key Fingerprint: SHA256:rVnhx3DAKjujCwWE13aDl7uV6+9U1MvydLkNRXJrBiA

View File

@ -50,14 +50,14 @@ function playNext() {
playQueueStore.isPlaying = false
} else {
playQueueStore.currentIndex++
player.value?.play()
playQueueStore.isPlaying = true
}
}
function playPrevious() {
if (player.value && (player.value.currentTime ?? 0) < 5 && playQueueStore.currentIndex > 0) {
playQueueStore.currentIndex--
player.value?.play()
playQueueStore.isPlaying = true
} else {
if (player.value) { player.value.currentTime = 0 }
}