pc.addEventListener("iceconnectionstatechange", (event) => {
if (pc.iceConnectionState === "failed") {
/* possibly reconfigure the connection in some way here */
/* then request ICE restart */
pc.restartIce();
}
});RTCPeerConnection: restartIce() method / notebook
RTCPeerConnection: restartIce() method
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.