Switch video quality
Let viewers lock a fixed video quality or return to adaptive bitrate (ABR) auto mode in the FastPix Android Player.
By default, the FastPix Android Player streams adaptively (ABR), choosing a rendition based on network conditions. Use these APIs, which are available on FastPixPlayer, to let users pick a fixed quality, such as 1080p, or switch back to auto. Quality switching doesn’t recreate the player or reset the playback position.
Before you begin
Make sure you have the following:
- The FastPix Android Player SDK installed, with a player backed by
FastPixPlayer. See Install FastPix Android player and Set up the player.
Get the FastPixPlayer instance from your PlayerView:
Get available and current qualities
Each VideoTrack exposes id, width, height, bitrate, label, isSelected, and isAuto. Use id when you call setVideoQuality.
Lock a fixed quality
Pass a quality id from getVideoQualities() to lock playback to that rendition.
Return to auto (ABR)
Listen for quality changes
The onVideoQualityChanged callback tells you both the new quality and whether the change came from a user action or the SDK’s automatic ABR switching.
Things to know
- Quality switching doesn’t recreate the player or reset the playback position.
- If a seek is in progress, the quality change is applied safely after the seek completes.
- Keep an Auto option in your quality menu that calls
enableAutoQuality(), so viewers can return to adaptive bitrate.
Frequently asked questions
What's the difference between setting a resolution and switching quality at runtime?
Setting a resolution with setFastPixMediaItem (maxResolution, minResolution, resolution) configures playback before it starts. The quality-switching APIs on this page (getVideoQualities, setVideoQuality, enableAutoQuality) let a viewer change quality during playback without reloading the stream.
Does switching quality restart the video?
No. Quality switching doesn’t recreate the player or reset the playback position. If a seek is in progress, the change is applied after the seek completes.
How do I know whether a change was manual or automatic?
The onVideoQualityChanged callback includes a source. It’s MANUAL when you call setVideoQuality or enableAutoQuality, and ABR when the SDK switches renditions automatically based on the network.
How do I let users return to adaptive bitrate?
Include an Auto entry in your quality menu that calls enableAutoQuality(). This re-enables ABR so the SDK selects the rendition automatically.
What’s next
- Set playback resolution to cap or fix resolution before playback starts.
- Control rendition order to set the adaptive streaming preference order.
- Listen to playback events for time, buffering, and error callbacks.