在IOS中使用webRTC音频呼叫时,如何识别两个客户端(任何一方)之间的网络丢失?在android中识别使用onPeerConnectionError。
这里是:
/** Called any time the IceConnectionState changes. */
- (void)peerConnection:(RTCPeerConnection *)__unused peerConnection didChangeIceConnectionState:(RTCIceConnectionState)newState {
/*
* RTCIceConnectionStateNew,
* RTCIceConnectionStateChecking,
* RTCIceConnectionStateConnected,
* RTCIceConnectionStateCompleted,
* RTCIceConnectionStateFailed,
* RTCIceConnectionStateDisconnected,
* RTCIceConnectionStateClosed,
* RTCIceConnectionStateCount,
*/
}
这是在RTCPeerConnectionDelegate中实现的
https://github.com/otalk/webrtc-ios/blob/master/include/RTCPeerConnectionDelegate.h#L59