Skip to content

Commit bb28160

Browse files
Checking if looping is enabled when sound ends and if it is creating and playing source sound again
1 parent 1f5d4f2 commit bb28160

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

v3/src/sound/webaudio/WebAudioSound.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,12 @@ var WebAudioSound = new Class({
120120
this.source.onended = function (ev) {
121121
if (ev.target === _this.source) {
122122
// sound ended
123-
_this.hasEnded = true;
123+
if (_this.currentConfig.loop) {
124+
_this.createAndStartBufferSource();
125+
}
126+
else {
127+
_this.hasEnded = true;
128+
}
124129
}
125130
// else was stopped
126131
};

0 commit comments

Comments
 (0)