mirror of
https://github.com/photonstorm/phaser
synced 2024-11-23 05:03:37 +00:00
Added stopAndReleaseAudioTag method to stop sound playback and mark audio tag as unused and release it for other sounds to use
This commit is contained in:
parent
8578319171
commit
f6de613fd0
1 changed files with 7 additions and 1 deletions
|
@ -82,7 +82,7 @@ var HTML5AudioSound = new Class({
|
|||
return false;
|
||||
}
|
||||
// \/\/\/ isPlaying = false, isPaused = false \/\/\/
|
||||
// TODO implement stop method
|
||||
this.stopAndReleaseAudioTag();
|
||||
this.events.dispatch(new SoundEvent(this, 'SOUND_STOP'));
|
||||
return true;
|
||||
},
|
||||
|
@ -139,6 +139,12 @@ var HTML5AudioSound = new Class({
|
|||
}
|
||||
return true;
|
||||
},
|
||||
stopAndReleaseAudioTag: function () {
|
||||
this.audio.pause();
|
||||
this.audio.dataset.used = 'false';
|
||||
this.audio = null;
|
||||
this.startTime = 0;
|
||||
},
|
||||
reset: function () {
|
||||
BaseSound.prototype.stop.call(this);
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue