Sound.resume wouldn't properly restart looped sounds in Chrome after being paused. Phaser now specifically handles the Chrome 42 bug and later fix (thanks @nkovacs #1820)

This commit is contained in:
photonstorm 2015-06-16 14:28:46 +01:00
parent c518fa32b7
commit ab8c98676e
3 changed files with 18 additions and 2 deletions

View file

@ -383,7 +383,7 @@ Version 2.4 - "Katar" - in dev
* Tween.to and Tween.from can now accept `null` as the ease parameter value. If `null` it will use the default tween, as per the documentation (thanks @nkovacs #1817) * Tween.to and Tween.from can now accept `null` as the ease parameter value. If `null` it will use the default tween, as per the documentation (thanks @nkovacs #1817)
* TilemapParser.parseTiledJSON would ignore 'falsey' properties set on Objects in Tiled JSON tilemaps, such as `x: 0` or `visible: false`. These properties are now accurately copied over to the destination map data (thanks @MaksJS #1818) * TilemapParser.parseTiledJSON would ignore 'falsey' properties set on Objects in Tiled JSON tilemaps, such as `x: 0` or `visible: false`. These properties are now accurately copied over to the destination map data (thanks @MaksJS #1818)
* Removed un-necessary PIXI.TextureCache pollution in Phaser.LoaderParser.bitmapFont. * Removed un-necessary PIXI.TextureCache pollution in Phaser.LoaderParser.bitmapFont.
* * Sound.resume wouldn't properly restart looped sounds in Chrome after being paused. Phaser now specifically handles the Chrome 42 bug and later fix (thanks @nkovacs #1820)
For changes in previous releases please see the extensive [Version History](https://github.com/photonstorm/phaser/blob/master/CHANGELOG.md). For changes in previous releases please see the extensive [Version History](https://github.com/photonstorm/phaser/blob/master/CHANGELOG.md).

View file

@ -803,10 +803,25 @@ Phaser.Sound.prototype = {
//this._sound.noteOn(0); // the zero is vitally important, crashes iOS6 without it //this._sound.noteOn(0); // the zero is vitally important, crashes iOS6 without it
} }
else else
{
if (this.loop && this.game.device.chrome)
{
// Handle chrome bug: https://code.google.com/p/chromium/issues/detail?id=457099
if (this.game.device.chromeVersion === 42)
{
this._sound.start(0);
}
else
{
this._sound.start(0, p);
}
}
else
{ {
this._sound.start(0, p, duration); this._sound.start(0, p, duration);
} }
} }
}
else else
{ {
this._sound.play(); this._sound.play();

View file

@ -654,6 +654,7 @@ declare module Phaser {
canvas: boolean; canvas: boolean;
chrome: boolean; chrome: boolean;
chromeOS: boolean; chromeOS: boolean;
chromeVersion: number;
cocoonJS: boolean; cocoonJS: boolean;
cocoonJSApp: boolean; cocoonJSApp: boolean;
cordova: boolean; cordova: boolean;