selectAudioTrack method
@detail api
@brief Specifies the playback track of the current media file.
@param index The specified playback audio track, starting from 0, and the range is [0, getAudioTrackCount()-1]. The value must be less than the return value of getAudioTrackCount{@link #IMediaPlayer#getAudioTrackCount}.
@return
- 0: Success.
- < 0 : Fail. See ReturnStatus{@link #ReturnStatus} for more details.
@note
- Call this API only when audio is mixing.
- This API is valid for audio file, not PCM data.
- After calling this API, you will receive onMediaPlayerEvent{@link #IMediaPlayerEventHandler#onMediaPlayerEvent} callback.
Implementation
Future<int?> selectAudioTrack(int index) async {
$a() => ($instance as $p_a.IMediaPlayer).selectAudioTrack(index);
$i() => ($instance as $p_i.ByteRTCMediaPlayer).selectAudioTrack(index);
if (Platform.isAndroid) {
return $a();
} else if (Platform.isIOS) {
return $i();
} else {
throw UnsupportedError(
'Not Support Platform ${Platform.operatingSystem}');
}
}