docs update and sound marker check.

This commit is contained in:
photonstorm 2015-01-01 19:51:02 +00:00
parent 97cf7f7581
commit b22233a0bc
2 changed files with 10 additions and 2 deletions

View file

@ -106,6 +106,7 @@ Android browser does not support Full Screen.
* The RandomDataGenerator could be seeded with an array of values. However if the array contained a zero it would stop seeding from that point (thanks @jpcloud @pnstickne #1456)
* Added extra checks to Sound.play to stop it throwing DOM Exception Error 11 if the `sound.readyState` wasn't set or the sound was invalid. Also wrapped `stop()`` call in a `try catch`.
* Time.reset would incorrectly reset the `_started` property, now maps it to `Time.time` (thanks @XekeDeath #1467)
* Fix floating point inaccuracy in Tween easing edge cases (thanks @jounii #1492)
### Pixi.js 2.2.0 Updates

View file

@ -447,7 +447,7 @@ Phaser.Sound.prototype = {
*/
play: function (marker, position, volume, loop, forceRestart) {
if (typeof marker === 'undefined') { marker = ''; }
if (typeof marker === 'undefined' || marker === false || marker === null) { marker = ''; }
if (typeof forceRestart === 'undefined') { forceRestart = true; }
if (this.isPlaying && !this.allowMultiple && !forceRestart && !this.override)
@ -480,10 +480,17 @@ Phaser.Sound.prototype = {
}
}
this.currentMarker = marker;
if (marker === '' && Object.keys(this.markers).length > 0)
{
// If they didn't specify a marker but this is an audio sprite,
// we should never play the entire thing
return this;
}
if (marker !== '')
{
this.currentMarker = marker;
if (this.markers[marker])
{
// Playing a marker? Then we default to the marker values