Skip to content

Commit 65f8820

Browse files
committed
SoundManager.unlock checks for audio start support and falls back to noteOn if not found.
1 parent 30ef362 commit 65f8820

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ Version 2.3.0 - "Tarabon" - in dev
6666

6767
### Bug Fixes
6868

69-
69+
* SoundManager.unlock checks for audio `start` support and falls back to `noteOn` if not found.
7070

7171
For changes in previous releases please see the extensive [Version History](https://github.com/photonstorm/phaser/blob/master/CHANGELOG.md).
7272

src/sound/SoundManager.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,15 @@ Phaser.SoundManager.prototype = {
236236
this._unlockSource = this.context.createBufferSource();
237237
this._unlockSource.buffer = buffer;
238238
this._unlockSource.connect(this.context.destination);
239-
this._unlockSource.noteOn(0);
239+
240+
if (typeof this._unlockSource.start === 'undefined')
241+
{
242+
this._unlockSource.noteOn(0);
243+
}
244+
else
245+
{
246+
this._unlockSource.start(0);
247+
}
240248
}
241249

242250
},

0 commit comments

Comments
 (0)