targetQualities property

  1. @override
AudioQualities? get targetQualities
inherited

One or more desired qualities of the media track.

Remarks:

  • If desired qualities are present, the Adaptive Bitrate mechanism of the player will limit itself to these qualities.
  • If one desired quality is present, the Adaptive Bitrate mechanism of the player will be disabled and the desired quality will be played back.

Limitations:

  • Not available on iOS

Implementation

@override
AudioQualities? get targetQualities => _targetQualities;
  1. @override
set targetQualities (List<AudioQuality>? targetQualities)
override

Implementation

@override
set targetQualities(List<AudioQuality>? targetQualities) {
  super.targetQualities = targetQualities;

  List<THEOplayerAudioQuality>? theoplayerQualities;

  if (targetQualities != null) {
    theoplayerQualities = [];

    var flutterUidMap = targetQualities.map((element) => element.uid);

    for (var i = 0; i < _nativeAudioTrack.qualities.length; i++) {
      THEOplayerAudioQuality q = _nativeAudioTrack.qualities[i];
      if (flutterUidMap.contains(q.uid)) {
        theoplayerQualities.add(q);
      }
    }
  }

  _nativeAudioTrack.targetQuality = theoplayerQualities;
}