parseConnectionStateChange method

String parseConnectionStateChange(
  1. RTCPeerConnectionState connectionState
)

Parses the RTCPeerConnectionState to a human-readable string.

Implementation

String parseConnectionStateChange(RTCPeerConnectionState connectionState) {
  switch (connectionState) {
    case RTCPeerConnectionState.RTCPeerConnectionStateNew:
      return 'new';
    case RTCPeerConnectionState.RTCPeerConnectionStateConnecting:
      return 'connecting';
    case RTCPeerConnectionState.RTCPeerConnectionStateConnected:
      return 'connected';
    case RTCPeerConnectionState.RTCPeerConnectionStateDisconnected:
      return 'disconnected';
    case RTCPeerConnectionState.RTCPeerConnectionStateFailed:
      return 'failed';
    case RTCPeerConnectionState.RTCPeerConnectionStateClosed:
      return 'closed';
  }
}