setTrack method

void setTrack(
  1. PipFlutterPlayerAsmsTrack track
)

Setup track parameters for currently played video. Can be only used for HLS or DASH data source.

Implementation

void setTrack(PipFlutterPlayerAsmsTrack track) {
  if (videoPlayerController == null) {
    throw StateError("The data source has not been initialized");
  }
  _postEvent(PipFlutterPlayerEvent(PipFlutterPlayerEventType.changedTrack,
      parameters: <String, dynamic>{
        "id": track.id,
        "width": track.width,
        "height": track.height,
        "bitrate": track.bitrate,
        "frameRate": track.frameRate,
        "codecs": track.codecs,
        "mimeType": track.mimeType,
      }));

  videoPlayerController!
      .setTrackParameters(track.width, track.height, track.bitrate);
  _pipFlutterPlayerAsmsTrack = track;
}