Skip to main content
Version: 7.3.0

How to programmatically select a video track quality

This article describes how you can use the API to select a video track quality. If you select a specific quality, you overrule the ABR algorithm.

The VideoTrack API, which is a sub-API of the MediaTrack API, can be used to implement this functionality. Implementing this functionality is a common use-case for developers who want to build their own UI to toggle a specific video quality.


Web SDKAndroid SDKiOS SDKtvOS SDKAndroid TV SDKChromecast SDK

Code examples

The code examples below show how to implement selecting video track qualities across SDKs.


The Web SDK leverages the MediaTrack API.

// enable a specific video track quality
player.videoTracks[0].targetQuality =

// do ABR on a set of qualities
player.videoTracks[0].targetQuality = [

// set to default ABR algorithm
player.videoTracks[0].targetQuality = null;
Android (TV) SDK

The Android SDK leverages the MediaTrack API.

// enable a specific video track quality

// do ABR on a set of qualities
ArrayList<VideoQuality> selectedVideoQualities = new ArrayList<>();
theoplayer.getPlayer().getVideoTracks().getItem(0).setTargetQualities(selectedVideoQualities); // ABR algorithm only executed to qualities belonging to selectedVideoQualities

// set to default ABR algorithm
iOS (/tvOS) SDK

The iOS SDK leverages the ABR API. The underlying AVFoundation stack, which THEOplayer has to use, brings along the technical limitation that you cannot select a specific video quality. Instead, you can set a maximum resolution or bitrate.

// set preferred peak bitrate
self.theoplayer.abr.preferredPeakBitRate = 200000

// self.theoplayer.abr.preferredPeakBitRate = nil // removes any bitrate limitation

// preferredMaximumResolution supported starting from iOS 11 and above
// self.theoplayer.abr.preferredMaximumResolution = CGSize(width: 1280, height: 720)
// self.theoplayer.abr.preferredMaximumResolution = // removes any resolution limitation