1
Fork 0
mirror of https://github.com/jech/galene.git synced 2024-11-10 02:35:58 +01:00

Enable simulcast on Firefox.

Firefox uses a non-standard protocol for simulcast, which has been
supported by Pion for a while now.  Enable simulcast in Firefox.
This commit is contained in:
Juliusz Chroboczek 2022-03-20 21:52:24 +01:00
parent ba75bfeb3a
commit 148c49d253

View file

@ -855,11 +855,9 @@ async function setSendParameters(c, bps, simulcast) {
if(!s.track || s.track.kind !== 'video') if(!s.track || s.track.kind !== 'video')
continue; continue;
let p = s.getParameters(); let p = s.getParameters();
if(!p.encodings) if((!p.encodings ||
p.encodings = [{}]; !simulcast && p.encodings.length != 1) ||
if((!simulcast && p.encodings.length != 1) ||
(simulcast && p.encodings.length != 2)) { (simulcast && p.encodings.length != 2)) {
// change the simulcast envelope
await replaceUpStream(c); await replaceUpStream(c);
return; return;
} }
@ -1213,15 +1211,12 @@ function setUpStream(c, stream) {
streams: [stream], streams: [stream],
sendEncodings: encodings, sendEncodings: encodings,
}); });
if(t.kind === 'video') {
let p = tr.sender.getParameters(); // Firefox workaround
if(!p.encodings) { let p = tr.sender.getParameters();
// Firefox workaround if(!p.encodings || p.encodings.length != encodings.length) {
updateSettings({simulcast: 'off'}); p.encodings = encodings;
reflectSettings(); tr.sender.setParameters(p);
p.encodings = [encodings[0]];
tr.sender.setParameters(p);
}
} }
} }