Plyr: Is it possible to give a custom name to a quality level?

Created on 20 Apr 2020  路  4Comments  路  Source: sampotts/plyr

Instead of using the size as the name in the quality selector, is it possible to use a custom name for each size. E.g. instead of displaying "1080", "360" display "HD", "Fast"?

Note that I don't mean changing the badge but the whole name of the quality level

Thanks!

Most helpful comment

This is a good point. Perhaps the feature should be called "versions" and be a bit looser in future versions.

All 4 comments

I found the solution after a bit of digging, I missed it at first because qualityLabel isn't in default.js

const player = new Plyr('#player', {
    settings: ['quality'],
    quality: {
          default: 1080,
          options: [1080, 360]
    },
    i18n: {
        qualityLabel: {
        1080: "HD",
        360: "Fast"
    },
    qualityBadge: {
        1080: "",
        360: ""
    },
    quality: 'Video Version'
 }
});

This is a good point. Perhaps the feature should be called "versions" and be a bit looser in future versions.

I wanted to slightly expand on this. I'm working on a project that will provide 2 options in the same quality, but one of them is a video-only option. I was trying to cheat the system but decreasing size and handling the labeling differently in the player, which is obviously not a clean solution. Thoughts?

@Mz49 I think it's a fine solution, don't treat this switcher as quality switcher but as version switcher.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ahmadshc picture ahmadshc  路  3Comments

elliottcoe picture elliottcoe  路  4Comments

muuvmuuv picture muuvmuuv  路  3Comments

jwjcmw picture jwjcmw  路  4Comments

Antonio-Laguna picture Antonio-Laguna  路  3Comments