From f3b7091332235b58d784cc6b11b4772638e68a36 Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Sun, 3 May 2020 20:26:52 +0200 Subject: [PATCH] Add a little delay before marking peer as ready --- assets/js/components/calls/window.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/assets/js/components/calls/window.js b/assets/js/components/calls/window.js index af20a39f..7e5ba11b 100644 --- a/assets/js/components/calls/window.js +++ b/assets/js/components/calls/window.js @@ -863,9 +863,14 @@ class CallWindow extends CustomEvents { this.mainPeer.on("connect", () => { console.info("Connected to remote peer!") - ws("calls/mark_ready", { - callID: this.callID - }) + setTimeout(() => { + // Add a little delay before notifying other peers in order to let the tracks be received by the proxy + if(this.mainPeer && !this.mainPeer.destroyed) + ws("calls/mark_ready", { + callID: this.callID + }) + }, 2000); + }) this.mainPeer.on("message", message => {