-
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
Fine-tuning of HLS.js compile parameters #2316
Comments
@stevendesu the incentive for this is indeed very valid. |
@OrenMe @stevendesu Some initial work has been performed, but needs more review and work: #2274 |
I felt like simply wrapping a few require statements in |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Is your feature request related to a problem? Please describe.
I would like to create the smallest possible build for my player, given that I know precisely what type of data will be fed to it (exact encodings, subtitle format, etc)
Describe the solution you'd like
Currently in order to reduce the build size of my player, instead of linking to
hls.js
, I link tohls.js/src/hls
and then use thewebpack.DefinePlugin
to set values for__USE_SUBTITLES__
,__USE_ALT_AUDIO__
, and__USE_EME_DRM__
. This has a dual benefit:hls.light.js
)Even doing this, however, I noticed that several features exist in HLS.js that I simply will not use:
I also notice a couple of libraries being pulled in which I'm not sure we need:
crypt
(without EME DRM support, is this actually used for anything?)sample-aes
(as above, is there a reason for AES support?)Ideally I would like if additional flags, similar to
__USE_SUBTITLES__
, could be added for disabling these features at build time:__USE_CEA608__
__USE_ABR__
__USE_ERROR_MESSAGES__
As well, I think it may be worth verifying that
crypt
andsample-aes
are necessary when__USE_EME_DRM__
is false.Describe alternatives you've considered
As mentioned above, I've utilized the flags I currently have available to get the player as small as possible (which resulting in approximately 70 KB of savings over using HLS.js directly)
Additional context
I'm using Webpack v4.30.0, NodeJS v11.10.0, NPM v6.9.0 and performing my builds on Mac OS X 10.14.6
The particular player I'm building utilizes VideoJS (with a custom VideoJS plugin for including HLS.js) along with various other plugins of my own design. Utilizing
videojs/core.js
(drops its internal HLS support, WebVTT support, and a few other features that are covered by HLS.js) adds 176.9 KB to the player. HLS.js (with my modifications as mentioned above) is another 179.57 KB. Additional node modules (whatwg-fetch
,events
,fast-text-encoding
, etc) bring my finalvendor.js
bundle to 435.99 KB. All of my personal code total 158.07 KB, and I have 90.47 KB of language files for i18n. My final player size is therefore roughly 685 KB. Ideally (not likely) I would like to get this below 500 KB. I can work on shrinking the size of my own code (and already have a plan for refactoring that should save about 50% space) and I can load i18n stuff asynchronously, but I'm still looking for somewhere to save 15-20 KB. I believe that disabling CEA-608 support in HLS.js (roughly 13.69 KB) is a good first step towards this.The text was updated successfully, but these errors were encountered: