Skip to content

Commit b22233a

Browse files
committed
docs update and sound marker check.
1 parent 97cf7f7 commit b22233a

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ Android browser does not support Full Screen.
106106
* 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)
107107
* 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`.
108108
* Time.reset would incorrectly reset the `_started` property, now maps it to `Time.time` (thanks @XekeDeath #1467)
109+
* Fix floating point inaccuracy in Tween easing edge cases (thanks @jounii #1492)
109110

110111
### Pixi.js 2.2.0 Updates
111112

src/sound/Sound.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ Phaser.Sound.prototype = {
447447
*/
448448
play: function (marker, position, volume, loop, forceRestart) {
449449

450-
if (typeof marker === 'undefined') { marker = ''; }
450+
if (typeof marker === 'undefined' || marker === false || marker === null) { marker = ''; }
451451
if (typeof forceRestart === 'undefined') { forceRestart = true; }
452452

453453
if (this.isPlaying && !this.allowMultiple && !forceRestart && !this.override)
@@ -480,10 +480,17 @@ Phaser.Sound.prototype = {
480480
}
481481
}
482482

483-
this.currentMarker = marker;
483+
if (marker === '' && Object.keys(this.markers).length > 0)
484+
{
485+
// If they didn't specify a marker but this is an audio sprite,
486+
// we should never play the entire thing
487+
return this;
488+
}
484489

485490
if (marker !== '')
486491
{
492+
this.currentMarker = marker;
493+
487494
if (this.markers[marker])
488495
{
489496
// Playing a marker? Then we default to the marker values

0 commit comments

Comments
 (0)