Can PeerConnection recover from failed state?
The RTCPeerConnectionState enum is summary of the states of the components, it’s not really an individual state.
So if the IceConnectionState or the RTCDtlsTransport is capable of getting out of the “failed” state, the PC can get out of it too.
The RTCIceConnectionState enum tells you that this is a collective of the RTCIceTransport state.
I don’t think RTCDtlsTransport is capable of recovering from “failed”, so if it fails, you need a new one.
RTCDtlsTransport objects are created when a description is applied (search for “newly created RTCDtlsTransport”). It’s not obvious that even doing a new ICERestart will get you a new DTLS transport.
So the safe procedure is to delete the RTCPeerConnection and start over.
Read more here: Source link
