I think same as: https://stackoverflow.com/questions/69502340/ios-15-web-audio-playback-stops-working-in-safari-after-locking-screen-for-a-fe Initially web audio works using tap sound on interaction. After some time left alone and I revisit the open web app there is no sound any more. As well it seem inconsistent when changing apps it sometime works, and sometime stops working, or if it is some kind of time limit even though the phone is on, with unlocked screen. This bug is not about playing backgroud audio, but sound on user interactions.
Could it be the AudioSession being suspended after a few minutes of inactivity? In that case, this might be fixed by https://bugs.webkit.org/show_bug.cgi?id=237654. @renduser, could you reproduce the issue and send me a sysdiagnose (youenn@apple.com)? Or give a precise repro case. For instance, would the following allow you to reproduce: - open https://airhorner.com, validate sound can be triggered. - wait some time - validate sound cannot be triggered.
Yes your example reproduces the issue. No sound after some time of inactivity i.e. screen lock, or doing other things with the screen still on and returning to it later. Calling resume() on every sound checking if "suspended" or "interrupted" doesn't help. Version iOS 15.4.1
<rdar://problem/92906510>
Committed r291268 (248417@main): <https://commits.webkit.org/248417@main> *** This bug has been marked as a duplicate of bug 237654 ***