hls.js icon indicating copy to clipboard operation
hls.js copied to clipboard

Proposal - Code splitting / modularization

Open michaelcunningham19 opened this issue 6 years ago • 4 comments

Is your feature request related to a problem? Please describe.

No issue in particular, other than not easily being able to easily omit certain pieces of functionality. We offer a 'light' build that currently removes:

  • alt-audio support
  • subtitles support
  • EME support

However depending on the combination of features desired (e.g. if someone wants EME support but not subtitles or alt-audio support) they're either forced to build from source with local code modifications or use the main fully-featured build.

Describe the solution you'd like

Perhaps a 'plugin' system - where core functionality stays in place and utilizes a set of provided plugins.

Further design details TBD

Describe alternatives you've considered

None. Are there any other alternative approaches to tackle this?

Additional context

We should still always provide the main and light builds for the folks that want them.

It would be really slick if we also have the ability to easily build from source with a selectable list of features, so no local code modifications are needed.

As well, we could come up with some other pre-built options to offer alongside the main and light builds.

michaelcunningham19 avatar Mar 13 '19 13:03 michaelcunningham19

@michaelcunningham19

https://github.com/video-dev/hls.js/pull/2274#issue-287948727 is a work in progress. Please review this PR when you're available. I'm sorry for your inconvenience.

Korilakkuma avatar Jun 14 '19 03:06 Korilakkuma

I agree this is needed, as the "light" build is really not suited for the most common use case where everything except for EME is needed. IMO the published library should not solve every possible use case. We need to continue offering updates for the UMD packages available today, but more modular approaches could be solved by those integrating the player using es6 exports. See #2910.

robwalch avatar Jul 25 '20 19:07 robwalch

Related conversation #6307

robwalch avatar Apr 04 '24 20:04 robwalch