Closed adwpc closed 3 years ago
Reference: https://developer.mozilla.org/en-US/docs/Web/API/RTCOfferOptions/iceRestart
pc.oniceconnectionstatechange = function(evt) {
if (pc.iceConnectionState === "failed") {
if (pc.restartIce) {
pc.restartIce();
} else {
pc.createOffer({ iceRestart: true })
.then(pc.setLocalDescription)
.then(sendOfferToServer);
}
}
}
lgtm! have you been able to test it? do we require any changes on the sfu side?
In my test: 1 iceConnectionState changed to "disconnected" in 35s after i switched my network 2 restartIce will trigger onNegotiationNeeded(createOffer-->setLocalDescription-->signal.offer-->setRemoteDescription), signal should support reconnect first(jsonrpc and grpc :() https://stackoverflow.com/questions/13797262/how-to-reconnect-to-websocket-after-close-connection need this one: #156
Description
add restartIce
Reference issue
Fixes #154 depend on #156