Skip to content

Commit 0d20a41

Browse files
Fixed class docs
1 parent 735394b commit 0d20a41

1 file changed

Lines changed: 11 additions & 20 deletions

File tree

src/sound/html5/HTML5AudioSound.js

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
* @copyright 2018 Photon Storm Ltd.
44
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
55
*/
6-
76
var Class = require('../../utils/Class');
87
var BaseSound = require('../BaseSound');
98

@@ -17,18 +16,14 @@ var BaseSound = require('../BaseSound');
1716
* @constructor
1817
* @author Pavle Goloskokovic <pgoloskokovic@gmail.com> (http://prunegames.com)
1918
* @since 3.0.0
20-
*
19+
*
2120
* @param {Phaser.Sound.HTML5AudioSoundManager} manager - Reference to the current sound manager instance.
2221
* @param {string} key - Asset key for the sound.
23-
* @param {ISoundConfig} [config={}] - An optional config object containing default sound settings.
22+
* @param {SoundConfig} [config={}] - An optional config object containing default sound settings.
2423
*/
2524
var HTML5AudioSound = new Class({
26-
2725
Extends: BaseSound,
28-
29-
initialize:
30-
31-
function HTML5AudioSound (manager, key, config)
26+
initialize: function HTML5AudioSound (manager, key, config)
3227
{
3328
if (config === void 0) { config = {}; }
3429

@@ -43,7 +38,6 @@ var HTML5AudioSound = new Class({
4338
* @since 3.0.0
4439
*/
4540
this.tags = manager.game.cache.audio.get(key);
46-
4741
if (!this.tags)
4842
{
4943
// eslint-disable-next-line no-console
@@ -86,11 +80,8 @@ var HTML5AudioSound = new Class({
8680
* @since 3.0.0
8781
*/
8882
this.previousTime = 0;
89-
9083
this.duration = this.tags[0].duration;
91-
9284
this.totalDuration = this.tags[0].duration;
93-
9485
BaseSound.call(this, manager, key, config);
9586
},
9687

@@ -101,10 +92,10 @@ var HTML5AudioSound = new Class({
10192
*
10293
* @method Phaser.Sound.HTML5AudioSound#play
10394
* @since 3.0.0
104-
*
95+
*
10596
* @param {string} [markerName=''] - If you want to play a marker then provide the marker name here, otherwise omit it to play the full sound.
10697
* @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.
107-
*
98+
*
10899
* @return {boolean} Whether the sound started playing successfully.
109100
*/
110101
play: function (markerName, config)
@@ -139,7 +130,7 @@ var HTML5AudioSound = new Class({
139130
*
140131
* @method Phaser.Sound.HTML5AudioSound#pause
141132
* @since 3.0.0
142-
*
133+
*
143134
* @return {boolean} Whether the sound was paused successfully.
144135
*/
145136
pause: function ()
@@ -178,7 +169,7 @@ var HTML5AudioSound = new Class({
178169
*
179170
* @method Phaser.Sound.HTML5AudioSound#resume
180171
* @since 3.0.0
181-
*
172+
*
182173
* @return {boolean} Whether the sound was resumed successfully.
183174
*/
184175
resume: function ()
@@ -218,7 +209,7 @@ var HTML5AudioSound = new Class({
218209
*
219210
* @method Phaser.Sound.HTML5AudioSound#stop
220211
* @since 3.0.0
221-
*
212+
*
222213
* @return {boolean} Whether the sound was stopped successfully.
223214
*/
224215
stop: function ()
@@ -251,7 +242,7 @@ var HTML5AudioSound = new Class({
251242
* @method Phaser.Sound.HTML5AudioSound#pickAndPlayAudioTag
252243
* @private
253244
* @since 3.0.0
254-
*
245+
*
255246
* @return {boolean} Whether the sound was assigned an audio tag successfully.
256247
*/
257248
pickAndPlayAudioTag: function ()
@@ -303,7 +294,7 @@ var HTML5AudioSound = new Class({
303294
* @method Phaser.Sound.HTML5AudioSound#pickAudioTag
304295
* @private
305296
* @since 3.0.0
306-
*
297+
*
307298
* @return {boolean} Whether the sound was assigned an audio tag successfully.
308299
*/
309300
pickAudioTag: function ()
@@ -446,7 +437,7 @@ var HTML5AudioSound = new Class({
446437
* @method Phaser.Sound.HTML5AudioSound#update
447438
* @protected
448439
* @since 3.0.0
449-
*
440+
*
450441
* @param {number} time - The current timestamp as generated by the Request Animation Frame or SetTimeout.
451442
* @param {number} delta - The delta time elapsed since the last frame.
452443
*/

0 commit comments

Comments
 (0)