mirror of
https://github.com/photonstorm/phaser
synced 2024-11-22 12:43:26 +00:00
Update WebAudioSoundManager.js
This commit is contained in:
parent
058e81937b
commit
d3d73d4c09
1 changed files with 26 additions and 1 deletions
|
@ -343,7 +343,32 @@ var WebAudioSoundManager = new Class({
|
||||||
{
|
{
|
||||||
var context = this.context;
|
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();
|
context.resume();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue