Skip to content

Commit d6256c4

Browse files
Defined startTime property
1 parent 82819ec commit d6256c4

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

src/sound/html5/HTML5AudioSound.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,16 @@ var HTML5AudioSound = new Class({
2626
* @default null
2727
*/
2828
this.audio = null;
29+
/**
30+
* Timestamp as generated by the Request Animation Frame or SetTimeout
31+
* representing the time at which the delayed sound playback should start.
32+
* Set to 0 if sound playback is not delayed.
33+
*
34+
* @private
35+
* @property {number} startTime
36+
* @default 0
37+
*/
38+
this.startTime = 0;
2939
this.duration = this.tags[0].duration;
3040
this.totalDuration = this.tags[0].duration;
3141
BaseSound.call(this, manager, key, config);
@@ -192,8 +202,7 @@ Object.defineProperty(HTML5AudioSound.prototype, 'seek', {
192202
if (this.isPlaying || this.isPaused) {
193203
value = Math.min(Math.max(0, value), this.duration);
194204
if (this.isPlaying) {
195-
this.previousTime =
196-
this.audio.currentTime = value;
205+
this.audio.currentTime = value;
197206
}
198207
else if (this.isPaused) {
199208
this.currentConfig.seek = value;

0 commit comments

Comments
 (0)