mirror of
https://github.com/photonstorm/phaser
synced 2025-02-17 14:38:30 +00:00
Checking if source is null before stopping sound on ended handler because it is called also when stop() method is called on it
This commit is contained in:
parent
1808fab27e
commit
04eb680d52
1 changed files with 3 additions and 1 deletions
|
@ -110,7 +110,9 @@ var WebAudioSound = new Class({
|
|||
this.source.connect(this.muteNode);
|
||||
this.applyConfig();
|
||||
this.source.onended = function (ev) {
|
||||
this.stop();
|
||||
if (this.source) {
|
||||
this.stop();
|
||||
}
|
||||
}.bind(this);
|
||||
this.source.start(0, offset, duration);
|
||||
},
|
||||
|
|
Loading…
Add table
Reference in a new issue