1
Fork 0
mirror of https://github.com/jech/galene.git synced 2024-11-22 16:45:58 +01:00

Restart ICE in client on up connection failures.

This commit is contained in:
Juliusz Chroboczek 2020-06-11 19:11:36 +02:00
parent 9c25696d01
commit 4b32c55a57

View file

@ -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;