Skip to content

Commit 187379a

Browse files
Always topping and removing loop buffer source when setting loop property as it needs to be reset even if setting it to true
1 parent 4d95cac commit 187379a

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

v3/src/sound/webaudio/WebAudioSound.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -388,12 +388,10 @@ Object.defineProperty(WebAudioSound.prototype, 'loop', {
388388
set: function (value) {
389389
this.currentConfig.loop = value;
390390
if (this.isPlaying) {
391+
this.stopAndRemoveLoopBufferSource();
391392
if (value) {
392393
this.createAndStartLoopBufferSource();
393394
}
394-
else {
395-
this.stopAndRemoveLoopBufferSource();
396-
}
397395
}
398396
}
399397
});

0 commit comments

Comments
 (0)