handleRemoteRestartIce method

void handleRemoteRestartIce(
  1. String transportId,
  2. IceParameters iceParameters,
  3. Span? restartIceSpan
)

Implementation

void handleRemoteRestartIce(String transportId, IceParameters iceParameters,
    Span? restartIceSpan) async {
  try {
    if (_sendTransport?.id == transportId) {
      _sendTransport!.restartIce(iceParameters);
      _webSocket!.socket
          .request('iceRestarted', {"transportId": _sendTransport!.id});
    }
    if (_recvTransport?.id == transportId) {
      _recvTransport!.restartIce(iceParameters);
      _webSocket!.socket
          .request('iceRestarted', {"transportId": _recvTransport!.id});
    }

    if (restartIceSpan != null) {
      videoSDKTelemetery!.completeSpan(
        span: restartIceSpan,
        status: StatusCode.ok,
        message: "iceRestarted",
      );
    }
  } catch (error) {
    //
    VideoSDKLog.createLog(
        message: "Error in restartICE() \n ${error.toString()}",
        logLevel: "ERROR");

    log("error in iceRestart $error");

    if (restartIceSpan != null) {
      videoSDKTelemetery!.completeSpan(
        span: restartIceSpan,
        status: StatusCode.error,
        message: "iceRestart Failed \n ${error.toString()}",
      );
    }
  }
}