clappr / clappr-level-selector-plugin

Clappr Level Selector Plugin
MIT License
76 stars 56 forks source link

Show level's height (720p, 480p) instead of bitrate #39

Closed NicholasAsimov closed 8 years ago

NicholasAsimov commented 8 years ago

So I've looked into this thing and it seems that hls.js and flashls have different _fillLevels methods. hls.js is using '${level.bitrate/1000}Kbps' while flashls uses '${levels[index].height}p'. Can we unify them and maybe make them an option to choose between kbps and height.

leandromoreira commented 8 years ago

@NicholasAsimov you can name your label as you wish:

var player = new Clappr.Player({
  source: "http://your.video/here.m3u8",
  plugins: {
    'core': [LevelSelector]
  },
  levelSelectorConfig: {
    title: 'Quality',
    labels: {
        2: 'High', // 500kbps
        1: 'Med', // 240kbps
        0: 'Low', // 120kbps
    }
  },
});

Maybe an interesting thing would be a wrapper/callback for you to label it in runtime.

NicholasAsimov commented 8 years ago

Thanks for the answer! This issue can be closed.