Skip to content

Commit 7b90fc7

Browse files
updating pausedTime value on method calls for WebAudioSound
1 parent f7f5beb commit 7b90fc7

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

v3/src/sound/webaudio/WebAudioSound.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,21 +67,26 @@ var WebAudioSound = new Class({
6767
this.applyConfig();
6868
this.source.start();
6969
this.startTime = this.manager.context.currentTime;
70+
this.pausedTime = 0;
7071
return this;
7172
},
7273
pause: function () {
7374
BaseSound.prototype.pause.call(this);
75+
this.pausedTime = this.manager.context.currentTime - this.startTime;
7476
return this;
7577
},
7678
resume: function () {
7779
BaseSound.prototype.resume.call(this);
80+
this.startTime = this.manager.context.currentTime - this.pausedTime;
81+
this.pausedTime = 0;
7882
return this;
7983
},
8084
stop: function () {
8185
BaseSound.prototype.stop.call(this);
8286
this.source.stop();
8387
this.source = null;
8488
this.startTime = 0;
89+
this.pausedTime = 0;
8590
return this;
8691
},
8792
update: function () {

0 commit comments

Comments
 (0)