From 2380e2e183ef362c6ee6da0ebf58d249a49e92bf Mon Sep 17 00:00:00 2001 From: Juliusz Chroboczek Date: Fri, 15 Jan 2021 22:41:40 +0100 Subject: [PATCH] The up streams rework broke renegotiation. Don't attempt to renegotiate, just close the stream and open it again. --- static/galene.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/static/galene.js b/static/galene.js index 2d1177f..5b6dc9e 100644 --- a/static/galene.js +++ b/static/galene.js @@ -1013,12 +1013,11 @@ async function addLocalMedia(id) { } let old = id && serverConnection.up[id]; + if(old) + old.close(); - if(!audio && !video) { - if(old) - old.close(); + if(!audio && !video) return; - } let constraints = {audio: audio, video: video}; /** @type {MediaStream} */ @@ -1027,8 +1026,6 @@ async function addLocalMedia(id) { stream = await navigator.mediaDevices.getUserMedia(constraints); } catch(e) { displayError(e); - if(old) - old.close(); return; }