Commit a845e9f7 authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Special-case screenshare in setSendParameters.

This avoids restarting the stream when changing simulcast
settings.
parent 5722270c
...@@ -918,6 +918,8 @@ function newUpStream(localId) { ...@@ -918,6 +918,8 @@ function newUpStream(localId) {
async function setSendParameters(c, bps, simulcast) { async function setSendParameters(c, bps, simulcast) {
if(!c.up) if(!c.up)
throw new Error('Setting throughput of down stream'); throw new Error('Setting throughput of down stream');
if(c.label === 'screenshare')
simulcast = false;
let senders = c.pc.getSenders(); let senders = c.pc.getSenders();
for(let i = 0; i < senders.length; i++) { for(let i = 0; i < senders.length; i++) {
let s = senders[i]; let s = senders[i];
...@@ -1250,12 +1252,12 @@ function setUpStream(c, stream) { ...@@ -1250,12 +1252,12 @@ function setUpStream(c, stream) {
}; };
let encodings = []; let encodings = [];
let simulcast = doSimulcast(); let simulcast = c.label !== 'screenshare' && doSimulcast();
if(t.kind === 'video') { if(t.kind === 'video') {
let bps = getMaxVideoThroughput(); let bps = getMaxVideoThroughput();
// Firefox doesn't like us setting the RID if we're not // Firefox doesn't like us setting the RID if we're not
// simulcasting. // simulcasting.
if(simulcast && c.label !== 'screenshare') { if(simulcast) {
encodings.push({ encodings.push({
rid: 'h', rid: 'h',
maxBitrate: bps || unlimitedRate, maxBitrate: bps || unlimitedRate,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment