mirror of
https://github.com/photonstorm/phaser
synced 2024-11-23 21:24:09 +00:00
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:
parent
89fce9135a
commit
4210898a24
1 changed files with 2 additions and 1 deletions
|
@ -244,7 +244,8 @@ var WebAudioSound = new Class({
|
||||||
update: function (time, delta) {
|
update: function (time, delta) {
|
||||||
if (this.hasEnded) {
|
if (this.hasEnded) {
|
||||||
this.hasEnded = false;
|
this.hasEnded = false;
|
||||||
this.stop();
|
BaseSound.prototype.stop.call(this);
|
||||||
|
this.stopAndRemoveBufferSource();
|
||||||
this.events.dispatch(new SoundEvent(this, 'SOUND_ENDED'));
|
this.events.dispatch(new SoundEvent(this, 'SOUND_ENDED'));
|
||||||
}
|
}
|
||||||
else if (this.hasLooped) {
|
else if (this.hasLooped) {
|
||||||
|
|
Loading…
Reference in a new issue