-
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
HTML5 tech preload property is lost on minify #2191
Comments
Thanks for the fantastic bug report! You hit the nail on the head, this was a result of aggressive mangling via Closure Compiler. We've removed Closure Compiler and switched to Uglify in master (#1586), so things like this shouldn't be [as much of] an issue in 5.0 and beyond. Master is frozen for minor releases, but we're still patching 4.12. Want to submit a pull request to fix this? If so, please make sure to make it against the stable branch. |
The issue you referenced (#1586) mentions an src/js/exports.js file which I was not previously aware of. It seems to be the proper place to fix this, but I am not completely certain how this should work. For example, the As a side-question: is there more information on the time-path and proposed changes for 5.0? It might be an option for us to switch to 5.0 if its release is within reasonable time. |
@geniusdex 5.0 should be fully released in the next month, but you can start using it now without too much pain. It'd be great if someone can confirm this is fixed in 5.0 so we can close the issue. |
Just tested this (http://output.jsbin.com/jijecateri) and it seems to work correctly now. |
Awesome, thanks @nickygerritsen! |
What did you do? (steps to reproduce)
When attempting to call the
preload()
method on a player using the HTML5 tech, the method throws an error if a minified version of the source is loaded:This is triggered by the following document:
What happened? (actual results)
The console log shows an error:
What should have happened? (expected results)
The console log shows the correct preload value:
Video.js version (e.g. v4.3.0)
v4.12.7 (current stable)
Video.js plugins used (e.g. videojs-youtube)
None
Browsers + platforms where this is happening (e.g. Windows XP IE8)
Chromium 39.0.2171.65 Ubuntu 14.04
Findings
The following line in
src/js/media/html5.js
seems to cause the error:Both
preload
values get minified away, which results in the following minified source:This results in 2 issues:
Qa
cannot be found bytechGet
when looking forpreload
, andQa
is not a valid property of aHTMLVideoElement
.Changing the original source line to the following fixes the error and gives the expected output:
I am unsure if this problem exists in other places.
The text was updated successfully, but these errors were encountered: