duration method

Future<double?> duration()

The duration function on HMSAudioFilePlayerNode will return the total duration of audio shared.

Refer Audio sharing in iOS guide here

Implementation

Future<double?> duration() async {
  var result = await PlatformService.invokeMethod(
      PlatformMethod.audioShareDuration,
      arguments: {"name": methodName});
  if (result["success"]) {
    return result["data"]["duration"];
  }
  return null;
}