The WebAudioSoundManager.onFocus method will now test to see if the state of the AudioContext is interrupted, as happens on iOS when leaving the page, and then resumes the context. Fix #5390 #5156 #4790

This commit is contained in:
Richard Davey 2021-03-24 17:37:40 +00:00
parent 187e855ac9
commit e5f4548961

View file

@ -341,9 +341,11 @@ var WebAudioSoundManager = new Class({
*/
onFocus: function ()
{
if (!this.locked)
var context = this.context;
if (context.state === 'suspended' || context.state === 'interrupted' || !this.locked)
{
this.context.resume();
context.resume();
}
},