sampotts / plyr

A simple HTML5, YouTube and Vimeo player
https://plyr.io
MIT License
26.38k stars 2.92k forks source link

Reduce file size using modules #894

Open thasmo opened 6 years ago

thasmo commented 6 years ago

plyr (v2) caught my eye, because it had a reasonable size (~40 KiB minified) while still supporting lots of features. I noticed that v3 minified has ~90 KiB now. Although this is still a lot less than e.g. video.js I'd like to point out that (for me) one feature of plyr is/was it's small size.

Have there been thoughts about making features modular so developers can add functionality on demand while keeping the footprint small?

Thanks for making plyr!

sampotts commented 6 years ago

Not sure where you got those numbers from:

Obviously v3 did increase file size, but the result is much more features, a cleaner code base, better API, etc, etc.

I do want to look at being able to include/exclude parts of the player as that would definitely help with filesize. Currently it's all dependent on each other.

Any help with this is appreciated...

thasmo commented 5 years ago

Just to be clear, I'm refering to the minified file sizes, which are also the sizes browser need to parse and execute, not the minified and gzipped sizes, which are only relevant for transfer time.

mourner commented 5 years ago

I'd love to see this too. I'm using Plyr exclusively for audio, so a lot of the code isn't needed in this case. So I'm not upgrading from v2 yet.