setAudioTrack method

void setAudioTrack(
  1. PipFlutterPlayerAsmsAudioTrack audioTrack
)

Set audioTrack in player. Works only for HLS or DASH streams.

Implementation

void setAudioTrack(PipFlutterPlayerAsmsAudioTrack audioTrack) {
  if (videoPlayerController == null) {
    throw StateError("The data source has not been initialized");
  }

  if (audioTrack.language == null) {
    _pipFlutterPlayerAsmsAudioTrack = null;
    return;
  }

  _pipFlutterPlayerAsmsAudioTrack = audioTrack;
  videoPlayerController!.setAudioTrack(audioTrack.label, audioTrack.id);
}