mirror of
https://github.com/photonstorm/phaser
synced 2025-02-16 14:08:28 +00:00
WebAudioSound
will now set hasEnded = false
as part of stopAndRemoveBufferSource
, after the source has been stopped and disconnected. This should prevent it from being left in a true
state if the source onended
callback fired late, after the sound had been re-played. Fix #6657
This commit is contained in:
parent
8c9f7c7b37
commit
2dfd421495
1 changed files with 6 additions and 4 deletions
|
@ -444,13 +444,17 @@ var WebAudioSound = new Class({
|
|||
{
|
||||
if (this.source)
|
||||
{
|
||||
this.source.stop();
|
||||
this.source.disconnect();
|
||||
var tempSource = this.source;
|
||||
|
||||
this.source = null;
|
||||
|
||||
tempSource.stop();
|
||||
tempSource.disconnect();
|
||||
}
|
||||
|
||||
this.playTime = 0;
|
||||
this.startTime = 0;
|
||||
this.hasEnded = false;
|
||||
|
||||
this.stopAndRemoveLoopBufferSource();
|
||||
},
|
||||
|
@ -622,8 +626,6 @@ var WebAudioSound = new Class({
|
|||
|
||||
if (this.hasEnded)
|
||||
{
|
||||
this.hasEnded = false;
|
||||
|
||||
BaseSound.prototype.stop.call(this);
|
||||
|
||||
this.stopAndRemoveBufferSource();
|
||||
|
|
Loading…
Add table
Reference in a new issue