Commit de634491 authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

More paranoid match for Firefox bandwidth workaround.

parent a698011a
...@@ -1220,8 +1220,20 @@ function setUpStream(c, stream) { ...@@ -1220,8 +1220,20 @@ function setUpStream(c, stream) {
}); });
// Firefox workaround // 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(); let p = tr.sender.getParameters();
if(!p.encodings || p.encodings.length != encodings.length) { if(!p || !match(p.encodings, encodings)) {
p.encodings = encodings; p.encodings = encodings;
tr.sender.setParameters(p); tr.sender.setParameters(p);
} }
......
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