videojs / videojs-contrib-quality-levels

Other
157 stars 51 forks source link

Editing quality list #82

Closed amirmasoud closed 4 years ago

amirmasoud commented 5 years ago

Description

m3u8 playlist only has BANDWIDTH with not WIDTH or HEIGHT, the output is undefined.

Question

How to handle QualityList based on bitrate? any way to edit the quality list without creating a new one?

jawngee commented 4 years ago

@amirmasoud

You can do it manually:

player.qualityLevels().on('addqualitylevel', (event) => {
    let qualityLevel = event.qualityLevel;
    if (qualityLevel.bitrate == 1756000) {
        qualityLevel.width = 1280;
        qualityLevel.height = 720;
    } else if (qualityLevel.bitrate == 704000) {
        qualityLevel.width = 640;
        qualityLevel.height = 360;
    }
});

(this works with videojs-http-source-selector)

amirmasoud commented 4 years ago

Thanks @jawngee It's been a while from the issue, I think I just stayed with auto switcher at the time.