onIceCandidate method

void onIceCandidate(
  1. RTCIceCandidate iceCandidate,
  2. String? endpointName
)

Sends the onIceCandidate to the WebSocket server

Implementation

void onIceCandidate(RTCIceCandidate iceCandidate, String? endpointName) {
  final Map<String, String> onIceCandidateParams = {
    'candidate': iceCandidate.candidate!,
    'sdpMid': iceCandidate.sdpMid!,
    'sdpMLineIndex': iceCandidate.sdpMLineIndex.toString(),
  };
  if (endpointName != null) {
    onIceCandidateParams['endpointName'] = endpointName;
  }
  idsOnIceCandidate.add(
      sendJson(JsonConstants.onIceCandidateMethod, onIceCandidateParams));
}