Commit eb6ab8aa authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Implement workaround for older browsers that don't have transceivers.

parent 3959afb9
...@@ -652,7 +652,7 @@ async function gotOffer(id, labels, offer) { ...@@ -652,7 +652,7 @@ async function gotOffer(id, labels, offer) {
if(label) { if(label) {
c.labels[e.track.id] = label; c.labels[e.track.id] = label;
} else { } else {
console.error("Couldn't find label for track"); console.warn("Couldn't find label for track");
} }
c.stream = e.streams[0]; c.stream = e.streams[0];
setMedia(id); setMedia(id);
...@@ -1075,15 +1075,21 @@ async function negotiate(id) { ...@@ -1075,15 +1075,21 @@ async function negotiate(id) {
await c.pc.setLocalDescription(offer); await c.pc.setLocalDescription(offer);
// mids are not known until this point // mids are not known until this point
c.pc.getTransceivers().forEach(t => { if(typeof(c.pc.getTransceivers) === 'function') {
if(t.sender && t.sender.track) { c.pc.getTransceivers().forEach(t => {
let label = c.labels[t.sender.track.id]; if(t.sender && t.sender.track) {
if(label) let label = c.labels[t.sender.track.id];
c.labelsByMid[t.mid] = label; if(label)
else c.labelsByMid[t.mid] = label;
console.error("Couldn't find label for track"); else
} console.warn("Couldn't find label for track");
}); }
});
} else {
console.warn('getTransceivers undefined');
displayWarning('getTransceivers undefined, please upgrade your browser');
// let the server deal with the mess
}
send({ send({
type: 'offer', type: 'offer',
......
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