diff --git a/src/sound/webaudio/WebAudioSoundManager.js b/src/sound/webaudio/WebAudioSoundManager.js index 6b6a69c01..e3f63c711 100644 --- a/src/sound/webaudio/WebAudioSoundManager.js +++ b/src/sound/webaudio/WebAudioSoundManager.js @@ -343,7 +343,32 @@ var WebAudioSoundManager = new Class({ { var context = this.context; - if (context.state === 'suspended' || context.state === 'interrupted' || !this.locked) + if ((context.state === 'suspended' || context.state === 'interrupted') && !this.locked) + { + context.resume(); + } + }, + + /** + * Update method called on every game step. + * Removes destroyed sounds and updates every active sound in the game. + * + * @method Phaser.Sound.WebAudioSoundManager#update + * @protected + * @fires Phaser.Sound.Events#UNLOCKED + * @since 3.0.0 + * + * @param {number} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. + * @param {number} delta - The delta time elapsed since the last frame. + */ + update: function (time, delta) + { + BaseSoundManager.prototype.update.call(this, time, delta); + + var context = this.context; + + // Resume interrupted audio on iOS + if (context && context.state === 'interrupted') { context.resume(); }