Cleanup transport on ice fail
@@ -187,11 +187,12 @@ func NewWebRTCTransport(id string, options map[string]interface{}) *WebRTCTransp
})
w.pc.OnICEConnectionStateChange(func(connectionState webrtc.ICEConnectionState) {
- if connectionState == webrtc.ICEConnectionStateDisconnected {
+ switch connectionState {
+ case webrtc.ICEConnectionStateDisconnected:
log.Errorf("webrtc ice disconnected")
+ case webrtc.ICEConnectionStateFailed:
+ log.Errorf("webrtc ice failed")
w.alive = false
-
- // Trigger cleanup
w.shutdownChan <- id
}
})
