From 94133e4c11e4ce323fa1dc644c83ae5c98ed39fd Mon Sep 17 00:00:00 2001 From: Richard Davey Date: Sat, 22 Feb 2014 03:05:41 +0000 Subject: [PATCH] Updated Sound.play loop check --- README.md | 3 ++- src/sound/Sound.js | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index d0bc9c1f..6230eee0 100644 --- a/README.md +++ b/README.md @@ -143,6 +143,7 @@ Updates: * TilemapParser will now throw a warning if the tileset image isn't the right size for the tile dimensions. * We now force IE11 into Canvas mode to avoid a Pixi bug with pre-multiplied alpha. Will remove once that is fixed, sorry, but it's better than no game at all, right? :( * Loader.setPreloadSprite() will now set sprite.visible = true once the crop has been applied. Should help avoid issues (#430) on super-slow connections. +* Updated the way the page visibility is checked, should now be more compatible across more browsers. Bug Fixes: @@ -161,7 +162,7 @@ Bug Fixes: * If pixelPerfect Input Sprites overlapped each other the pixel check wasn't taken into consieration in the Pointer move method. * Updated Input.Mouse to use event.button not event.which, so the const reference from input.mouse.button is correct (thanks grimor) * Text that was fixedToCamera would 'jitter' if the world scrolled. Now works as expected across all fixed objects. - +* Fixed a bug where Sound.play wouldn't pick-up the local loop setting if not specified in the parameter. TO DO: diff --git a/src/sound/Sound.js b/src/sound/Sound.js index 09f4e8ff..a69b1804 100644 --- a/src/sound/Sound.js +++ b/src/sound/Sound.js @@ -341,7 +341,7 @@ Phaser.Sound.prototype = { if (this.currentTime >= this.durationMS) { - //console.log(this.currentMarker, 'has hit duration'); + console.log(this.currentMarker, 'has hit duration'); if (this.usingWebAudio) { if (this.loop) @@ -400,7 +400,7 @@ Phaser.Sound.prototype = { position = position || 0; if (typeof volume === 'undefined') { volume = this._volume; } - if (typeof loop === 'undefined') { loop = false; } + if (typeof loop === 'undefined') { loop = this.loop; } if (typeof forceRestart === 'undefined') { forceRestart = true; } // console.log(this.name + ' play ' + marker + ' position ' + position + ' volume ' + volume + ' loop ' + loop, 'force', forceRestart);