现在有个需求场景,需要播放背景音乐,我使用的cc.audioEngine.playMusic
然后在玩游戏的过程中,调用了window.prompt,这时背景音乐就被暂停掉了,点取消或者确定都无法恢复声音
案例代码,在 start
中加上以下代码
cc.audioEngine.playMusic(this.bgmAudio, true); this.scheduleOnce(() => { window.prompt(); }, 3);
这里使用 scheduleOnce
只是模拟在游戏过程中使用 window.prompt
使用的版本是2.4.2,打包成Web Mobile,iOS版本:13.5.1,型号:6S