Calling stop method when sound ends

This commit is contained in:
Pavle Goloskokovic 2017-11-26 16:24:49 +01:00
parent 53dbf050d4
commit 1808fab27e

View file

@ -109,7 +109,9 @@ var WebAudioSound = new Class({
this.source.buffer = this.audioBuffer;
this.source.connect(this.muteNode);
this.applyConfig();
// TODO add onended event handler to reset sound state
this.source.onended = function (ev) {
this.stop();
}.bind(this);
this.source.start(0, offset, duration);
},
/**