Merge pull request #912 from j0hnskot/onDecoded-patch

Fix for bug #906
This commit is contained in:
Richard Davey 2014-07-01 15:42:09 +01:00
commit e1bc2b7bd6

View file

@ -290,7 +290,12 @@ Phaser.Sound = function (game, key, volume, loop, connect) {
* @private
*/
this._paused = false;
/**
* @property {boolean} _onDecodedEventDispatched - Was the onDecoded event dispatched?
* @private
*/
this._onDecodedEventDispatched = false;
};
Phaser.Sound.prototype = {
@ -357,6 +362,13 @@ Phaser.Sound.prototype = {
* @protected
*/
update: function () {
if (this.isDecoded && !this._onDecodedEventDispatched) {
this.onDecoded.dispatch(this);
this._onDecodedEventDispatched=true;
}
if (this.pendingPlayback && this.game.cache.isSoundReady(this.key))
{