Added Sound._muteVolume which stops Firefox and IE9 crashing if you try to unmute a sound that hasn't yet been muted, which can also happen as a result of a game visibility change (thanks @osmanzeki #1108 #1123)

This commit is contained in:
photonstorm 2014-09-01 03:13:05 +01:00
parent 80d1df4705
commit 8fec5169f0
2 changed files with 8 additions and 1 deletions

View file

@ -165,6 +165,7 @@ Version 2.1.0 - "Cairhien" - -in development-
* TilemapParser.getEmptyData now correct adds an empty bodies array into layers. This fixes an issue where p2 couldn't convert a csv map into collision tiles (thanks @sru #845)
* CocoonJS doesn't support mouse wheel events so they've been moved into a conditional check (thanks @videlais #1151)
* ScaleManager window.resize handler would constantly dispatch enterPortrait and enterLandscape events on window resizing, regardless if it actually entered that orientation or not.
* Added Sound._muteVolume which stops Firefox and IE9 crashing if you try to unmute a sound that hasn't yet been muted, which can also happen as a result of a game visibility change (thanks @osmanzeki #1108 #1123)
### p2.js 0.6.0 Changes and New Features

View file

@ -280,7 +280,13 @@ Phaser.Sound = function (game, key, volume, loop, connect) {
this._tempVolume = 0;
/**
* @property {boolean} _tempLoop - Internal marker var.
* @property {number} _muteVolume - Internal cache var.
* @private
*/
this._muteVolume = 0;
/**
* @property {boolean} _tempLoop - Internal cache var.
* @private
*/
this._tempLoop = 0;