Skip to main content
Version: 11.7.0

How to programmatically detect video track qualities on Web

This article describes how you can use the VideoTrack API, a sub-API of the MediaTrack API, to detect video track qualities. Implementing this functionality is a common use-case for developers who want to build their own UI to visualize the available video track qualities.

Usage

The qualities of a video track are available as soon as the track is added to player.videoTracks.

function handleAddTrackEvent(addTrackEvent) {
const videoTrackQualities = addTrackEvent.track.qualities;
}
player.videoTracks.addEventListener('addtrack', handleAddTrackEvent);