-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
Current TextTrackSettings should be a plugin to reduce weight of file #2998
Comments
While, the string template -- definitely not great, and hopefully, we'll fix that sooner rather than later -- is 5kb and not really minifiable, it gzips pretty well. The full file goes from 12K to under 2.5K when gzipped. So, really, it doesn't make much of a difference. So, removing it wouldn't really make videojs any more light weight and if you're not using gzipping on your server, you really should set it up. |
I just realized that we have #2746, so, we'll use that to track making the dialog not be a mess. |
Size is one reason and the template is just the quick way to see there is a lot to gain. One of the issue of the current version for example, is that it is using the dom as a storage for values. It limits possible values (if you try to set a specific color, it will generate an error because it's not a value of the select in the template), it is slower (accessing dom is a lot slower than accessing a variable in memory). Can't we create a TextTrackSettingsUI class for the popup (which should I think be in a plugin with CaptionSettingsMenuItem) and simplify the current TextTrackSettings to be a simple store with minimum data validation ? |
Yeah, as I said, what it's doing right now isn't great but it works. When we overhaul it, we'll make sure that the DOM isn't the source of truth as it is now. |
Current version of TextTrackSettings has a 5KB template (Non minimifiable as it is a string contant).
A simpler version without HTML interface to configure caption appearance seems to me that would be a more usual use case of captions and would greatly reduce file size (an the file size of the minimified file).
TL;DR : remove current TextTrackSettings from current default player to trim down size and replace it with an headless lightweight version.
The text was updated successfully, but these errors were encountered: