[LayaAir2]播放音频失败,InvalidStateError: Failed to start the audio device

报错信息:Unhandled Promise Rejection: InvalidStateError: Failed to start the audio device
场景: 来回切换后台,切到后台时停止背景音乐播放, 切到前台时重新播放背景音乐。但是多次切换后报错,无法播放背景音乐。
机型: ios18.6.2
版本:laya2.8
代码大概如下:
```ts
let timeoutId: number = 0;
const res = "xxx.mp3";
Laya.stage.on(Laya.Event.VISIBILITY_CHANGE, this, () => {
            clearTimeout(this.timeoutId);
            Laya.SoundManager.stopAll();
            if (Laya.stage.isVisibility) {
               timeoutId = window.setTimeout(()=>{Laya.SoundManager.playMusic(res, 0)}, 500);
            }
        });
```
已邀请:

要回复问题请先

商务合作
商务合作