1
Fork 0

Simpler Firefox workaround in addUpTrack.

Rather than trying to determine whether the workaround is needed,
we now perform it unconditionally, and ignore the resulting exception
on non-broken browsers.
This commit is contained in:
Juliusz Chroboczek 2023-04-13 22:26:41 +02:00
parent 3ea4b8a32a
commit 7f93aa5dc8
1 changed files with 11 additions and 0 deletions

View File

@ -1265,6 +1265,17 @@ function setUpStream(c, stream) {
streams: [stream],
sendEncodings: encodings,
});
// Firefox before 110 does not implement sendEncodings, and
// requires this hack, which throws an exception on Chromium.
try {
let p = tr.sender.getParameters();
if(!p.encodings) {
p.encodings = encodings;
tr.sender.setParameters(p);
}
} catch(e) {
}
}
// c.stream might be different from stream if there's a filter