-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optimize bundle size #4936
Comments
v1.2.4 is just over 40% larger than v0.14.15. Many changes made over the last four years have contributed to what makes this library what it is today.
Besides a lot of features and fixes that did not impact the bundle size significantly, the additional 97 kB consists of support for:
An additional 16-20 kB of minified payload can be expected in v1.3.0 with the DRM enhancements being introduced. One solution for users interested in only a subset of features is to leverage alternate build targets like hls-light. However, to create new build targets that meet users' core use cases, we must define what features are essential to users looking to leverage a smaller bundle. hls.light JS dist files do not include EME, subtitles, or alternate-audio support which is probably too extreme for most users in 2022. When building the player, four environment vars can be used to customize the light build: USE_ALT_AUDIO: 18 kB (with the exception of the most basic playback or muted playback, this is not a very usable feature to disable) USE_EME_DRM: 19 kB (this will increase with v1.3) USE_SUBTITLES: 54 kB 👀 (subtitle or CC support is required for most use cases. Can you isolate your delivery format to just one, and would we save significant space by omitting support of only some formats?) USE_CMCD: 8 kB Audio and subs exclusion should probably be removed for the average HLS use case in 2022. Additionally, modules like LatencyController or KeyLoader could be excluded or reduced if Live playback and latency or content encryption are not a concern. Low latency, progressive streaming, and several other v1 features above are core to the stream-controller architecture. They would be difficult to isolate or stub out of a build (even LatencyController is used by some API features and could not be stubbed without additional work). Which features are non-essential in a build optimized for bundle size and a common HLS use case? |
great explaination |
Is your feature request related to a problem? Please describe.
hls@0.14 mostly worked fine for the core use case. hls@1 is approx. 45% larger. This isn't acceptable for things that load over the internet (especially when loading millions of these per week.)
Describe the solution you'd like
from the other ticket:
Agreed. We shouldn't close issues that actually track that as a desired feature. (#3830 )
The issue is not a discussion point like stack overflow, it's a feature request. Closing it simply pretends that the issue is solved, and makes it harder for other users to find/coalesce around a common place for a given issue.
Additional context
I don't know why you marked the discussion as locked/heated. Maybe it's because the internet lacks tone, but there's no malice behind my #3830 . I'm just stating that this is something your users care about.
The text was updated successfully, but these errors were encountered: