File tree Expand file tree Collapse file tree
packages/webgal/src/UI/Backlog Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -127,15 +127,12 @@ export const Backlog = () => {
127127 < div
128128 onClick = { ( ) => {
129129 playSeClick ( ) ;
130- // 暂停其他所有正在播放的 backlog 语音,避免多条音频混合
131- const currentAudioId = 'backlog_audio_play_element_' + indexOfBacklog ;
130+ // 暂停所有 backlog 语音(包括当前;后续会重置并播放当前)
132131 document
133132 . querySelectorAll ( '[id^="backlog_audio_play_element_"]' )
134133 . forEach ( ( audio : any ) => {
135- if ( audio . id !== currentAudioId ) {
136- audio . pause ( ) ;
137- audio . currentTime = 0 ;
138- }
134+ audio . pause ( ) ;
135+ audio . currentTime = 0 ;
139136 } ) ;
140137 // 暂停游戏内正在播放的语音,避免与 backlog 语音混合
141138 const currentVocal = document . getElementById ( 'currentVocal' ) as HTMLAudioElement | null ;
@@ -146,7 +143,9 @@ export const Backlog = () => {
146143 // 卸载 vocal-play perform,避免其 blockingAuto 阻塞自动播放
147144 WebGAL . gameplay . performController . unmountPerform ( 'vocal-play' , true ) ;
148145 // 获取到播放 backlog 语音的元素
149- const backlog_audio_element : any = document . getElementById ( currentAudioId ) ;
146+ const backlog_audio_element : any = document . getElementById (
147+ 'backlog_audio_play_element_' + indexOfBacklog ,
148+ ) ;
150149 if ( backlog_audio_element ) {
151150 backlog_audio_element . currentTime = 0 ;
152151 const userDataStore = webgalStore . getState ( ) . userData ;
You can’t perform that action at this time.
0 commit comments