SoundManager.unlock checks for audio start support and falls back to noteOn if not found.

This commit is contained in:
photonstorm 2015-01-06 13:50:15 +00:00
parent 30ef362e59
commit 65f8820514
2 changed files with 10 additions and 2 deletions

View file

@ -66,7 +66,7 @@ Version 2.3.0 - "Tarabon" - in dev
### Bug Fixes
* SoundManager.unlock checks for audio `start` support and falls back to `noteOn` if not found.
For changes in previous releases please see the extensive [Version History](https://github.com/photonstorm/phaser/blob/master/CHANGELOG.md).

View file

@ -236,7 +236,15 @@ Phaser.SoundManager.prototype = {
this._unlockSource = this.context.createBufferSource();
this._unlockSource.buffer = buffer;
this._unlockSource.connect(this.context.destination);
this._unlockSource.noteOn(0);
if (typeof this._unlockSource.start === 'undefined')
{
this._unlockSource.noteOn(0);
}
else
{
this._unlockSource.start(0);
}
}
},