getPosition method

Future<int?> getPosition(
  1. int effectId
)

@detail api @brief Gets the current position of audio effect file playback. @param effectId Audio effect ID @return - >0: Success, the current progress of audio effect file playback in milliseconds. - < 0: Failure. @note - When playing online files, calling this API may cause a delay in playback. - Call this API after start{@link #IAudioEffectPlayer#start}.

Implementation

Future<int?> getPosition(int effectId) async {
  $a() => ($instance as $p_a.IAudioEffectPlayer).getPosition(effectId);
  $i() => ($instance as $p_i.ByteRTCAudioEffectPlayer).getPosition(effectId);

  if (Platform.isAndroid) {
    return $a();
  } else if (Platform.isIOS) {
    return $i();
  } else {
    throw UnsupportedError(
        'Not Support Platform ${Platform.operatingSystem}');
  }
}