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:
Pavle Goloskokovic 2017-11-26 16:27:39 +01:00
parent 1808fab27e
commit 04eb680d52

View file

@ -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);
},