mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-08 11:01:35 +00:00
stop playing simultaneously
This commit is contained in:
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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user