getAudioTrackCount method

Future<int?> getAudioTrackCount()

@detail api @brief Gets the track count of the current media file. @return + >= 0:Success. Return the track count of the current media file. - < 0:Failed. @note - Call this API only when audio is mixing. - This API is valid for audio file, not PCM data.

Implementation

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

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