DEV Community

Discussion on: Video.js Player|Quality Selector|Playlist|Dynamic Link Player

Collapse
 
istng profile image
Iván Gk

many thanks! I needed to change between qualities and was able to do it with the last code snippet, here is what I did:

var qualities = [];
player.one("loadedmetadata", () => {
  qualities = player.
  tech({ IWillNotUseThisInPlugins: true }).
  hls.representations();
});

function changeQuality(qualityIndex) {
  qualities.forEach(quality => quality.enabled(false));
  qualities[videoIndex].enabled(true);
}
Enter fullscreen mode Exit fullscreen mode

hope is useful for somebody!