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);

Do not hesitate to contact us in case you have any questions about how to improve your video streaming performance by clicking the button below.