start method

Future<int?> start()

@detail api @brief Start playing the audio. Call this API when you call open{@link #IMediaPlayer#open} and set AutoPlay=False. @return - 0: Success. - < 0 : Fail. See ReturnStatus{@link #ReturnStatus} for more details. @note

  • For audio file in PCM format, see openWithCustomSource{@link #IMediaPlayer#openWithCustomSource}. openWithCustomSource and this API are mutually exclusive.
  • After calling this API, call stop{@link #IMediaPlayer#stop} to stop playing the audio file.

Implementation

Future<int?> start() async {
  $a() => ($instance as $p_a.IMediaPlayer).start();
  $i() => ($instance as $p_i.ByteRTCMediaPlayer).start();

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