Custom Quality Labels

 

Example code

Here's an example of how you can group small definition qualities under the SD label for qualities smaller than 720p and group high definition qualities under the HD label otherwise:

var updateQualityLabel = function(event) {
    var qualities = event.track.qualities;
    for (var quality of qualities) {
        if (quality.height >= 720) {
            quality.label = "HD";
        }
        else {
            quality.label = "SD";
        }
    }
}
player.videoTracks.addEventListener('addtrack', updateQualityLabel);

Get Started