Skip to content

Commit 7a259da

Browse files
Updated BaseSoundManager play method to return value from sound play method call
1 parent ac7be30 commit 7a259da

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

src/sound/BaseSoundManager.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ var BaseSoundManager = new Class({
167167
* @method Phaser.Sound.BaseSoundManager#play
168168
* @param {string} key - Asset key for the sound.
169169
* @param {ISoundConfig | ISoundMarker} [extra] - An optional additional object containing settings to be applied to the sound. It could be either config or marker object.
170+
* @returns {boolean} Whether the sound started playing successfully.
170171
*/
171172
play: function (key, extra) {
172173
var sound = this.add(key);
@@ -175,14 +176,14 @@ var BaseSoundManager = new Class({
175176
if (extra) {
176177
if (extra.name) {
177178
sound.addMarker(extra);
178-
sound.play(extra.name);
179+
return sound.play(extra.name);
179180
}
180181
else {
181-
sound.play(extra);
182+
return sound.play(extra);
182183
}
183184
}
184185
else {
185-
sound.play();
186+
return sound.play();
186187
}
187188
},
188189
/**

0 commit comments

Comments
 (0)