1、视频播放结束后,需要鼓声前的bgm状态重置
This commit is contained in:
Wenzhe 2026-02-06 16:17:22 +08:00
parent 6c2f6f31f1
commit 33f504a674
1 changed files with 20 additions and 7 deletions

View File

@ -736,10 +736,17 @@ const handleVideoOpen = (isQianmenVideo = false) => {
playerStore.setVideoPlaying(true)
// BGM
// BGM
// BGM退BGM
// BGM
// BGM
if (playerStore.wasMusicPlayingBeforeDrum) {
// 使BGM
playerStore.wasMusicPlayingBeforeVideo = playerStore.wasMusicPlayingBeforeDrum
console.log('视频打开时保存鼓声播放前的BGM状态:', playerStore.wasMusicPlayingBeforeDrum)
} else {
// 使BGM
playerStore.saveMusicStateBeforeVideo()
console.log('视频打开时保存当前BGM状态:', playerStore.isMusicPlaying)
}
// BGM
if (audioPlayer.value && playerStore.isMusicPlaying) {
@ -762,7 +769,7 @@ const handleVideoClose = () => {
playerStore.setVideoPlaying(false)
// BGM
// BGMBGM
// BGMBGMBGM
const shouldResumeBGM = playerStore.restoreMusicStateAfterVideo()
console.log('视频关闭时是否应该恢复BGM播放:', shouldResumeBGM)
@ -781,7 +788,8 @@ const handleVideoClose = () => {
console.log('全局BGM已恢复播放视频已关闭')
}).catch(error => {
console.error('BGM恢复播放失败需要用户交互:', error)
// isMusicPlayingfalse
// 使UI
playerStore.setMusicPlaying(true)
})
} else {
//
@ -790,11 +798,16 @@ const handleVideoClose = () => {
}
} catch (error) {
console.error('BGM恢复播放失败需要用户交互:', error)
// isMusicPlayingfalse
// 使UI
playerStore.setMusicPlaying(true)
}
} else {
console.log('BGM保持暂停状态视频已关闭')
}
// BGM
playerStore.wasMusicPlayingBeforeDrum = false
console.log('视频关闭后重置鼓声播放前的BGM状态为:', playerStore.wasMusicPlayingBeforeDrum)
}
// webview