setAudioTrack method

Future<void> setAudioTrack(
  1. AudioTrack track
)

Sets the current AudioTrack for audio output.

  • Currently selected AudioTrack can be accessed using state.track.audio or stream.track.audio.
  • The list of currently available AudioTracks can be obtained accessed using state.tracks.audio or stream.tracks.audio.
  • External audio track can be loaded using AudioTrack.uri constructor.
player.setAudioTrack(
  AudioTrack.uri(
    'https://www.iandevlin.com/html5test/webvtt/v/upc-tobymanley.mp4',
    title: 'English',
    language: 'en',
  ),
);

Implementation

Future<void> setAudioTrack(AudioTrack track) async {
  return platform?.setAudioTrack(track);
}