stopHlsStreaming method

Future<void> stopHlsStreaming({
  1. HMSHLSConfig? hmshlsConfig,
  2. HMSActionResultListener? hmsActionResultListener,
})

Stops ongoing HLS streaming in the room hmsActionResultListener is a callback whose HMSActionResultListener.onSuccess will be called when the action completes successfully.

Refer HLS Streaming guide here

Implementation

Future<void> stopHlsStreaming(
    {HMSHLSConfig? hmshlsConfig,
    HMSActionResultListener? hmsActionResultListener}) async {
  var result = await PlatformService.invokeMethod(
      PlatformMethod.stopHlsStreaming,
      arguments: hmshlsConfig != null ? hmshlsConfig.toMap() : null);
  if (hmsActionResultListener != null) {
    if (result == null) {
      hmsActionResultListener.onSuccess(
          methodType: HMSActionResultListenerMethod.hlsStreamingStopped);
    } else {
      hmsActionResultListener.onException(
          hmsException: HMSException.fromMap(result["error"]),
          methodType: HMSActionResultListenerMethod.hlsStreamingStopped);
    }
  }
}