1
Fork 0
mirror of https://github.com/jech/galene.git synced 2024-12-22 15:25:48 +01:00

More paranoid match for Firefox bandwidth workaround.

This commit is contained in:
Juliusz Chroboczek 2022-03-21 19:40:41 +01:00
parent a698011aef
commit de63449150

View file

@ -1220,8 +1220,20 @@ function setUpStream(c, stream) {
});
// Firefox workaround
function match(a, b) {
if(!a || !b)
return false;
if(a.length !== b.length)
return false;
for(let i = 0; i < a.length; i++) {
if(a.maxBitrate !== b.maxBitrate)
return false;
}
return true;
}
let p = tr.sender.getParameters();
if(!p.encodings || p.encodings.length != encodings.length) {
if(!p || !match(p.encodings, encodings)) {
p.encodings = encodings;
tr.sender.setParameters(p);
}