stopAudioShare method

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

Method to stop audio share of other apps. (Android Only)

Parameter:

hmsActionResultListener - hmsActionResultListener is a callback instance on which HMSActionResultListener.onSuccess and HMSActionResultListener.onException will be called.

Refer audio share guide here

Implementation

Future<void> stopAudioShare(
    {HMSActionResultListener? hmsActionResultListener}) async {
  if (!Platform.isAndroid) {
    return;
  }
  var result =
      await PlatformService.invokeMethod(PlatformMethod.stopAudioShare);
  if (hmsActionResultListener != null) {
    if (result == null) {
      hmsActionResultListener.onSuccess(
          methodType: HMSActionResultListenerMethod.stopAudioShare);
    } else {
      hmsActionResultListener.onException(
          methodType: HMSActionResultListenerMethod.startAudioShare,
          hmsException: HMSException.fromMap(result["error"]));
    }
  }
}