fix: 修复外显状态不一致问题

This commit is contained in:
Astrian Zheng 2025-08-22 20:46:48 +10:00
parent 2ed26d587b
commit 2fdec7688b
Signed by: Astrian
SSH Key Fingerprint: SHA256:rVnhx3DAKjujCwWE13aDl7uV6+9U1MvydLkNRXJrBiA

View File

@ -11,7 +11,7 @@ export const usePlayState = defineStore('playState', () => {
const actualPlaying = ref(false) // 实际音频的播放与暂停 const actualPlaying = ref(false) // 实际音频的播放与暂停
// 外显播放状态方法 // 外显播放状态方法
const playingState = computed(() => isPlaying.value || actualPlaying.value) // 其中有一个为 true 时回报为 true const playingState = computed(() => isPlaying.value)
const playProgressState = computed(() => playProgress.value) const playProgressState = computed(() => playProgress.value)
const trackDurationState = computed(() => currentTrackDuration.value) const trackDurationState = computed(() => currentTrackDuration.value)
const actualPlayingState = computed(() => actualPlaying.value) const actualPlayingState = computed(() => actualPlaying.value)
@ -64,6 +64,7 @@ export const usePlayState = defineStore('playState', () => {
// 回报 Web Audio API 正在播放 // 回报 Web Audio API 正在播放
const reportActualPlaying = (playing: boolean) => { const reportActualPlaying = (playing: boolean) => {
actualPlaying.value = playing actualPlaying.value = playing
if (playing) isPlaying.value = true
} }
return { return {