mirror of
https://github.com/photonstorm/phaser
synced 2025-02-17 14:38:30 +00:00
Calling stop method when sound ends
This commit is contained in:
parent
53dbf050d4
commit
1808fab27e
1 changed files with 3 additions and 1 deletions
|
@ -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);
|
||||
},
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue