From a698011aef9292638452cd658488988214ab651a Mon Sep 17 00:00:00 2001 From: Juliusz Chroboczek Date: Mon, 21 Mar 2022 19:19:19 +0100 Subject: [PATCH] Don't set rid when not simulcasting. It turns out that the bandwidth limitation is not effective in Firefox when the rid is set unless we're simulcasting. --- static/galene.js | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/static/galene.js b/static/galene.js index 86c0882..0683a73 100644 --- a/static/galene.js +++ b/static/galene.js @@ -1189,16 +1189,23 @@ function setUpStream(c, stream) { let simulcast = doSimulcast(); if(t.kind === 'video') { let bps = getMaxVideoThroughput(); - encodings.push({ - rid: 'h', - maxBitrate: bps || unlimitedRate, - }); - if(simulcast) + // Firefox doesn't like us setting the RID if we're not + // simulcasting. + if(simulcast) { + encodings.push({ + rid: 'h', + maxBitrate: bps || unlimitedRate, + }); encodings.push({ rid: 'l', scaleResolutionDownBy: 2, maxBitrate: simulcastRate, }); + } else { + encodings.push({ + maxBitrate: bps || unlimitedRate, + }); + } } else { if(c.label !== 'camera' || settings.hqaudio) { encodings.push({