Skip to content

Commit

Permalink
Sound.pause will no longer fire a Sound.onStop signal, and the pause …
Browse files Browse the repository at this point in the history
…values are set before the onPause signal is dispatched (thanks @AnderbergE, fix #868)
  • Loading branch information
photonstorm committed Jun 5, 2014
1 parent 369e2cc commit 9aa10f7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ Version 2.0.6 - "Jornhill" - -in development-
* Canvas.create has deprecated the noCocoon parameter as it's no longer required. The parameter is still in the signature, but no longer used in the method.
* Time.add allows you to add an existing Phaser.Timer to the timer pool (request #864)
* Emitter.start has a new parameter: forceQuantity which will force the quantity of a flow of particles to be the given value (request #853)
* Sound.pause will no longer fire a Sound.onStop signal, and the pause values are set before the onPause signal is dispatched (thanks @AnderbergE, fix #868)

### CocoonJS Specific Updates

Expand Down
8 changes: 6 additions & 2 deletions src/sound/Sound.js
Original file line number Diff line number Diff line change
Expand Up @@ -657,12 +657,12 @@ Phaser.Sound.prototype = {

if (this.isPlaying && this._sound)
{
this.stop();
this.isPlaying = false;
this.paused = true;
this.pausedPosition = this.currentTime;
this.pausedTime = this.game.time.now;
this.onPause.dispatch(this);
this.stop();
}

},
Expand Down Expand Up @@ -762,7 +762,11 @@ Phaser.Sound.prototype = {
}

this.currentMarker = '';
this.onStop.dispatch(this, prevMarker);

if (!this.paused)
{
this.onStop.dispatch(this, prevMarker);
}

},

Expand Down

0 comments on commit 9aa10f7

Please sign in to comment.