
Implementing `onicecandidateerror` in Firefox — A Missing Piece of the WebRTC Spec
If you've ever debugged a WebRTC connection failure in Firefox and wished you had more information about why ICE candidate gathering failed, you're not alone. For years, Firefox was missing a spec-mandated event that Chrome had already implemented: onicecandidateerror (also known as RTCPeerConnectionIceErrorEvent ). I recently landed a patch that finally brings this to Firefox. Here's what the bug was, what the fix involved, and why it matters. What is onicecandidateerror ? When a WebRTC peer connection tries to gather ICE candidates, it contacts your configured STUN and TURN servers. If one of those servers is unreachable, misconfigured, or returns an error, the browser needs a way to tell you about it. The W3C WebRTC spec defines onicecandidateerror exactly for this purpose. It fires an RTCPeerConnectionIceErrorEvent with: url — which STUN/TURN server failed errorCode — the STUN error code (e.g. 401 Unauthorized, 701 for custom errors) errorText — human-readable error description add
Continue reading on Dev.to Webdev
Opens in a new tab




