sanity-io / sanity-mux-player

Play videos in the frontend uploaded with the MUX Sanity plugin
https://github.com/sanity-io/sanity-plugin-mux-input
21 stars 5 forks source link

Support (or migrate to) hls.light.js #20

Open j0nas opened 3 years ago

j0nas commented 3 years ago

When this package is included, the bundled hls.js chunk is a hefty 66.6kB gzipped. The hls.js package ships a dist/hls.light.js which is a lighter 49kB when gzipped, possibly even lighter post v1.0 (if #19 is fixed first).

The relevant section of hls.js' README includes the following:

NOTE: hls.light.*.js dist files do not include EME, subtitles, or alternate-audio support. In addition, the following types are not available in the light build:

  • AudioStreamController
  • AudioTrackController
  • CuesInterface
  • EMEController
  • SubtitleStreamController
  • SubtitleTrackController
  • TimelineController

If any of these features are relevant for sanity-mux-player, the package should allow opting out of them and bundle the light version of hls.js when the required conditions are met. If none of the listed features are required by sanity-mux-player, this package should simply migrate to using hls.light.js to lessen some of it's rather large bundle footprint. :slightly_smiling_face: