currentDuration method

Future<double?> currentDuration()

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

Refer Audio sharing in iOS guide here

Implementation

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