mirror of
https://github.com/jech/galene.git
synced 2024-11-26 02:25:58 +01:00
Handle client-side errors during negotiation.
This commit is contained in:
parent
0308719719
commit
d3655b8955
1 changed files with 17 additions and 2 deletions
|
@ -736,7 +736,14 @@ async function gotAnswer(id, answer) {
|
||||||
let c = up[id];
|
let c = up[id];
|
||||||
if(!c)
|
if(!c)
|
||||||
throw new Error('unknown up stream');
|
throw new Error('unknown up stream');
|
||||||
await c.pc.setRemoteDescription(answer);
|
try {
|
||||||
|
await c.pc.setRemoteDescription(answer);
|
||||||
|
} catch(e) {
|
||||||
|
console.error(e);
|
||||||
|
displayError(e);
|
||||||
|
delUpMedia(id);
|
||||||
|
return;
|
||||||
|
}
|
||||||
await addIceCandidates(c);
|
await addIceCandidates(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1117,7 +1124,15 @@ async function newUpStream() {
|
||||||
throw new Error("Couldn't create peer connection");
|
throw new Error("Couldn't create peer connection");
|
||||||
up[id] = new Connection(id, pc);
|
up[id] = new Connection(id, pc);
|
||||||
|
|
||||||
pc.onnegotiationneeded = e => negotiate(id);
|
pc.onnegotiationneeded = async e => {
|
||||||
|
try {
|
||||||
|
await negotiate(id);
|
||||||
|
} catch(e) {
|
||||||
|
console.error(e);
|
||||||
|
displayError(e);
|
||||||
|
delUpMedia(id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pc.onicecandidate = function(e) {
|
pc.onicecandidate = function(e) {
|
||||||
if(!e.candidate)
|
if(!e.candidate)
|
||||||
|
|
Loading…
Reference in a new issue