Skip to content

Commit 6730b3b

Browse files
Defined seek property for HTML5AudioSound class
1 parent d6b11e2 commit 6730b3b

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

src/sound/html5/HTML5AudioSound.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,4 +151,22 @@ Object.defineProperty(HTML5AudioSound.prototype, 'seek', {
151151
}
152152
}
153153
});
154+
/**
155+
* Property indicating whether or not
156+
* the sound or current sound marker will loop.
157+
*
158+
* @name Phaser.Sound.HTML5AudioSound#loop
159+
* @property {boolean} loop
160+
*/
161+
Object.defineProperty(HTML5AudioSound.prototype, 'loop', {
162+
get: function () {
163+
return this.currentConfig.loop;
164+
},
165+
set: function (value) {
166+
this.currentConfig.loop = value;
167+
if (this.audio) {
168+
this.audio.loop = value;
169+
}
170+
}
171+
});
154172
module.exports = HTML5AudioSound;

0 commit comments

Comments
 (0)