mirror of
https://github.com/jech/galene.git
synced 2024-11-22 16:45:58 +01:00
Implement workaround for older browsers that don't have transceivers.
This commit is contained in:
parent
3959afb952
commit
eb6ab8aa1a
1 changed files with 16 additions and 10 deletions
|
@ -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) {
|
||||||
await c.pc.setLocalDescription(offer);
|
await c.pc.setLocalDescription(offer);
|
||||||
|
|
||||||
// mids are not known until this point
|
// mids are not known until this point
|
||||||
|
if(typeof(c.pc.getTransceivers) === 'function') {
|
||||||
c.pc.getTransceivers().forEach(t => {
|
c.pc.getTransceivers().forEach(t => {
|
||||||
if(t.sender && t.sender.track) {
|
if(t.sender && t.sender.track) {
|
||||||
let label = c.labels[t.sender.track.id];
|
let label = c.labels[t.sender.track.id];
|
||||||
if(label)
|
if(label)
|
||||||
c.labelsByMid[t.mid] = label;
|
c.labelsByMid[t.mid] = label;
|
||||||
else
|
else
|
||||||
console.error("Couldn't find label for track");
|
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',
|
||||||
|
|
Loading…
Reference in a new issue