Open Florinstruct opened 5 months ago
Did you ever figure this out? I can't get it working either. Seems like incredibly unclear docs to me.
const player = (playerRef.current = videojs(videoElement, options, () => {
player.on('loadedmetadata', () => {
const qualityLevels = player.qualityLevels();
qualityLevels.on('change', function() {
console.log('Quality Level changed!');
console.log('New level:', qualityLevels[qualityLevels.selectedIndex]);
const currentTime = player.currentTime();
player.src(options.sources[qualityLevels.selectedIndex]); //<--- change the source
player.currentTime(currentTime); // <-- set the new source to the previous source current seek position
player.play();
});
});
}));
Description
I can't for the life of me find any info on how to actually change the quality. The following part from your documentation makes me think this is outside the scope of this plugin?!
Now, your documentation also says we need
videojs/http-streaming
and they write:So, which is it now? Does this plugin provide an API or does videojs itself?
Steps
I'm using this snippet from your page:
But this does nothing. Apparently, it's really just there to "update the QualityLevelList.selectedIndex_" - for whatever reason I would want to / have to do that myself.
If I am misunderstanding the README, there seem to be others. Maybe the documentation is just not clear?