stopRtmpAndRecording method

Future<void> stopRtmpAndRecording({
  1. HMSActionResultListener? hmsActionResultListener,
})

Stops a previously started rtmp recording or stream. See startRtmpOrRecording for starting.

hmsActionResultListener - hmsActionResultListener is the callback that would be called by SDK in case of success or failure.

Refer RTMP and Recording guide here

Implementation

Future<void> stopRtmpAndRecording(
    {HMSActionResultListener? hmsActionResultListener}) async {
  var result =
      await PlatformService.invokeMethod(PlatformMethod.stopRtmpAndRecording);

  if (hmsActionResultListener != null) {
    if (result == null) {
      hmsActionResultListener.onSuccess(
          methodType: HMSActionResultListenerMethod.stopRtmpAndRecording);
    } else {
      hmsActionResultListener.onException(
          methodType: HMSActionResultListenerMethod.stopRtmpAndRecording,
          hmsException: HMSException.fromMap(result["error"]));
    }
  }
}