stop playing simultaneously

This commit is contained in:
Brandon Thomas committed 2022-03-02 04:08:52 -05:00
1 parent f3f239ef73
commit 3013d76b57
1 file changed
+4 -2
@@ -63,7 +63,6 @@ class WebSocketProtocol {
}, 1000);
}
private onWebsocketError(event: Event) {
const that = this;
setTimeout(() => that.newWebsocket(), 1000);
@@ -106,10 +105,13 @@ class WebSocketProtocol {
const sound = new Howl({
src: [maybePlayableAudio.getUrl()],
onend: function(soundId: number) {
//that.playNextAvailableAudio(); // eagerly play the next one.
that.currentSound = undefined;
that.playNextAvailableAudio(); // eagerly play the next one.
}
});
this.currentSound = sound;
sound.play();
}
}