From 8c1957c6eef737cc60d10ad05b26faf3427cb92d Mon Sep 17 00:00:00 2001 From: Astrian Zheng Date: Sun, 25 May 2025 09:11:06 +1000 Subject: [PATCH] =?UTF-8?q?fix(Player):=20=E4=BF=AE=E5=A4=8D=E6=92=AD?= =?UTF-8?q?=E6=94=BE=E7=8A=B6=E6=80=81=E6=9C=AA=E6=AD=A3=E7=A1=AE=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在播放下一首或上一首时,直接调用 `player.value?.play()` 可能会导致播放状态未正确更新。通过设置 `playQueueStore.isPlaying = true` 来确保播放状态同步更新。 --- src/components/Player.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/Player.vue b/src/components/Player.vue index ccd40a7..fcc140a 100644 --- a/src/components/Player.vue +++ b/src/components/Player.vue @@ -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 } }