Replies: 4 comments
-
Hi @diviaki,
Reading through these issues might help clear up some of that fog: You can create a custom build with env args to toggle features (no change to build-config necessary): Lines 36 to 47 in 5cfbc0a Experimenting with modifying the build-config or src successfully should help too. It works by stubbing out modules and related controllers which are overridable and nullable in the config: Lines 523 to 538 in 5cfbc0a Since we introduced ES Modules (#2910), we haven't fully realized the potential for composition as an alternative to the approach above. I've had conversations with @cjpillsbury of Mux about refactoring hls.ts and config.ts so that the dependencies pulled in to DefaultConfig and the Hls entry point are composable. We need someone to file an issue, ideally with a commitment to contribute the changes. This approach could replace most of the build tasks that create the light build from directives that stub/null modules/config-options to new entry points that remove them through tree-shaking.
You want to remove modules in src/demux. There are no build options for this. This requires changes to modules that import
Both the transmuxer and base-stream-contollers depend on
Some might argue that you can save a lot by removing live support. Live is not encapsulated like other features in HLS.js. The "L" in HLS stands for "Live". You certainly could look at taking out the latency controller and hacking away at parts of the playlist loaders and utilities for merging live playlists. We'd take contributions in this area if they improve the code base and don't break existing functionally. I think if we were to bridge this gap however we need to start adding errors for when a "lite" build encounters a feature at runtime that it is unable to handle because of missing modules. That brings up the point that error and event constants are defined centrally. We like that, however it doesn't lend itself to the encapsulation that makes this kind of customization effective. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the extensive answer. |
Beta Was this translation helpful? Give feedback.
-
Another easy gain, commenting out these lines brings it down to 77K (saves 6k) and still back ts streams containing h264 and aac: const muxConfig: MuxConfig[] = [ src/demux/tsdemuxer.ts |
Beta Was this translation helpful? Give feedback.
-
removing Decrypter would save another 2K bringing it down to 75K |
Beta Was this translation helpful? Give feedback.
-
Hello!
Thank you for hls.js, it's pure gold. :)
I plan to use it on my video portal where all the videos are in the same format. No live-streaming h264+aac.
I realized I do not need fmp4 and crypt but do need altaudio. Because of the later I can not use the light distribution.
I realized I could add altaudio to the light version by modifying build-config.ts but have no clue how to ditch fmp4 or crypt.
I also in the fog what other features could be stripped that would result in a measurable decrease in the package size.
Any advice is welcome. :)
Beta Was this translation helpful? Give feedback.
All reactions