mirror of
https://github.com/jech/galene.git
synced 2024-11-22 08:35:57 +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:
parent
ba75bfeb3a
commit
148c49d253
1 changed files with 8 additions and 13 deletions
|
@ -855,11 +855,9 @@ async function setSendParameters(c, bps, simulcast) {
|
|||
if(!s.track || s.track.kind !== 'video')
|
||||
continue;
|
||||
let p = s.getParameters();
|
||||
if(!p.encodings)
|
||||
p.encodings = [{}];
|
||||
if((!simulcast && p.encodings.length != 1) ||
|
||||
if((!p.encodings ||
|
||||
!simulcast && p.encodings.length != 1) ||
|
||||
(simulcast && p.encodings.length != 2)) {
|
||||
// change the simulcast envelope
|
||||
await replaceUpStream(c);
|
||||
return;
|
||||
}
|
||||
|
@ -1213,17 +1211,14 @@ function setUpStream(c, stream) {
|
|||
streams: [stream],
|
||||
sendEncodings: encodings,
|
||||
});
|
||||
if(t.kind === 'video') {
|
||||
let p = tr.sender.getParameters();
|
||||
if(!p.encodings) {
|
||||
|
||||
// Firefox workaround
|
||||
updateSettings({simulcast: 'off'});
|
||||
reflectSettings();
|
||||
p.encodings = [encodings[0]];
|
||||
let p = tr.sender.getParameters();
|
||||
if(!p.encodings || p.encodings.length != encodings.length) {
|
||||
p.encodings = encodings;
|
||||
tr.sender.setParameters(p);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// c.stream might be different from stream if there's a filter
|
||||
c.stream.getTracks().forEach(addUpTrack);
|
||||
|
|
Loading…
Reference in a new issue