targetQuality property

  1. @override
AudioQuality? get targetQuality
inherited

The 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
AudioQuality? get targetQuality => _targetQuality;
  1. @override
set targetQuality (AudioQuality? targetQuality)
override

Implementation

@override
set targetQuality(AudioQuality? targetQuality) {
  super.targetQuality = targetQuality;

  List<THEOplayerAudioQuality>? theoplayerQualities;

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

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

  _nativeAudioTrack.targetQuality = theoplayerQualities;
}