stopRecording method

Future<void> stopRecording()

Implementation

Future<void> stopRecording() async {
  Span? stopRecordingSpan;
  try {
    if (videoSDKTelemetery != null) {
      stopRecordingSpan = videoSDKTelemetery!.trace(
        spanName: 'stopRecording() Start',
      );
    }
  } catch (error) {}

  try {
    await _webSocket!.socket.request('stopRecording', {});

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

    //
    log("Error while stopping recording $error");

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