From a845e9f722cd3a31d190c4740e49d899114f0e87 Mon Sep 17 00:00:00 2001 From: Juliusz Chroboczek Date: Fri, 14 Jul 2023 23:59:06 +0200 Subject: [PATCH] Special-case screenshare in setSendParameters. This avoids restarting the stream when changing simulcast settings. --- static/galene.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/static/galene.js b/static/galene.js index 7e6d4d2..f145b27 100644 --- a/static/galene.js +++ b/static/galene.js @@ -918,6 +918,8 @@ function newUpStream(localId) { async function setSendParameters(c, bps, simulcast) { if(!c.up) throw new Error('Setting throughput of down stream'); + if(c.label === 'screenshare') + simulcast = false; let senders = c.pc.getSenders(); for(let i = 0; i < senders.length; i++) { let s = senders[i]; @@ -1250,12 +1252,12 @@ function setUpStream(c, stream) { }; let encodings = []; - let simulcast = doSimulcast(); + let simulcast = c.label !== 'screenshare' && doSimulcast(); if(t.kind === 'video') { let bps = getMaxVideoThroughput(); // Firefox doesn't like us setting the RID if we're not // simulcasting. - if(simulcast && c.label !== 'screenshare') { + if(simulcast) { encodings.push({ rid: 'h', maxBitrate: bps || unlimitedRate,