Replaced stop method call with logic needed to stop sound in order to avoiding dispatching both stop and ended events

This commit is contained in:
Pavle Goloskokovic 2018-01-03 21:23:41 +01:00
parent 89fce9135a
commit 4210898a24

View file

@ -244,7 +244,8 @@ var WebAudioSound = new Class({
update: function (time, delta) {
if (this.hasEnded) {
this.hasEnded = false;
this.stop();
BaseSound.prototype.stop.call(this);
this.stopAndRemoveBufferSource();
this.events.dispatch(new SoundEvent(this, 'SOUND_ENDED'));
}
else if (this.hasLooped) {