mirror of
https://github.com/jech/galene.git
synced 2024-11-22 08:35:57 +01:00
Restart ICE in client on up connection failures.
This commit is contained in:
parent
9c25696d01
commit
4b32c55a57
1 changed files with 12 additions and 1 deletions
|
@ -1168,7 +1168,7 @@ async function newUpStream(id) {
|
|||
}
|
||||
}
|
||||
|
||||
pc.onicecandidate = function(e) {
|
||||
pc.onicecandidate = e => {
|
||||
if(!e.candidate)
|
||||
return;
|
||||
send({type: 'ice',
|
||||
|
@ -1177,6 +1177,17 @@ async function newUpStream(id) {
|
|||
});
|
||||
};
|
||||
|
||||
pc.oniceconnectionstatechange = e => {
|
||||
if(pc.iceConnectionState === 'failed') {
|
||||
try {
|
||||
pc.restartIce();
|
||||
} catch(e) {
|
||||
console.error(e);
|
||||
displayError(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pc.ontrack = console.error;
|
||||
|
||||
return id;
|
||||
|
|
Loading…
Reference in a new issue