Open joshmn opened 6 years ago
I think this would be an amazing contribution, although I think in most cases people really want a bitrate range
to label but then we'd need to change the id/bitrate number to a function or something dynamic. I'd like to see @clappr/core ideas cc @vagnervjs
labelsByRange: [
{belongs: between(0, 120000): label: 'Low'},
{belongs: between(120000, 240000): label: 'Mid'},
{belongs: between(240000, 500000): label: 'High'},
],
Maybe I'm wrong about the most useful case. We also need to ensure that we're not doubling features (or at lease reuse or rethink the labelCallback
)
Most things with javascript are completely above my paygrade, so I ended up being a lazy bloke :)
levelSelectorConfig: {
labelCallback: function(level, label) {
return BITRATE_LABELS[level.level.bitrate / 1000]
},
},
I see that there's only a way to go ID to label. Is there any chance for bitrate to label?
I may just end up adding this myself with a PR :)