Why is both hls.js and video.js used?

Peertube is using video.js with hls.js as a plugin. What’s the purpose of this setup (since HLS is supported by video.js)?

HLS.js is supported by our P2P library and we’re quite happy with it. We also don’t use the version of video.js that includes HLS support.

video.js supports HLS since version 7, which is the version that Peertube is using. But if HLS.js is good enough, why use video.js at all? I think it would reduce complexity and bundle size to just use one of them.

We use video.js bundle that does not include hls support.

video.js is a video framework we use with a lot of plugins (custom and official ones). But if you manage to reproduce the same player with all the features we have without using video.js, go for it!

I’m just curious to understand the setup and how the player works. If I understand it correctly it can be summarized as:

  • video.js is used because of the wide plugin support.
  • hls.js is used because it’s supported by the p2p library.

Thanks for explanation.