Skip to content

Commit 17a5cc6

Browse files
Added play method docs
1 parent 3018a25 commit 17a5cc6

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

src/sound/html5/HTML5AudioSound.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,16 @@ var HTML5AudioSound = new Class({
6060
this.totalDuration = this.tags[0].duration;
6161
BaseSound.call(this, manager, key, config);
6262
},
63+
/**
64+
* Play this sound, or a marked section of it.
65+
* It always plays the sound from the start. If you want to start playback from a specific time
66+
* you can set 'seek' setting of the config object, provided to this call, to that value.
67+
*
68+
* @method Phaser.Sound.HTML5AudioSound#play
69+
* @param {string} [markerName=''] - If you want to play a marker then provide the marker name here, otherwise omit it to play the full sound.
70+
* @param {ISoundConfig} [config] - Optional sound config object to be applied to this marker or entire sound if no marker name is provided. It gets memorized for future plays of current section of the sound.
71+
* @returns {boolean} Whether the sound started playing successfully.
72+
*/
6373
play: function (markerName, config) {
6474
if (this.manager.isLocked(this, 'play', [markerName, config])) {
6575
return false;

0 commit comments

Comments
 (0)