getPosition method

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

@detail api @brief 获取音效文件播放进度。 @param effectId 音效 ID @return - >0: 成功, 音效文件播放进度,单位为毫秒。 - < 0: 失败 @note - 在播放在线文件时,调用此接口可能造成播放延迟的现象。 - 仅在调用 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}');
  }
}