-
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
Too many globals added by videojs #603
Comments
Hmm, that's not right. On Jun 26, 2013, at 8:25 AM, Jeremy Elbourn notifications@github.com wrote:
|
xd and yd come from this minification oversight: https://github.com/videojs/video.js/blob/master/src/js/core.js#L55 pd seems to come from goog.base.js (part of closure compiler). pd isn't used anywhere after it's set, so CC is doing a bad job of removing that. My best guess is it's this var. vdata is part of the event system and gets added to any element that events get tracked on. |
Sounds like it's only that minification oversight that's problematic, then. In my case, a conflict with "xd" was causing random elements to be turned into video players. |
Heh, play all the things! Thanks for pointing that out. |
The first one is a pretty easy fix. Did you want to make a pull request and contribute some code? |
Perhaps another time; I'm not familiar with the testing framework and would have to get the whole environment set-up. |
No problem, though it's probably easier than you think. (i.e. make the commit in github; let Travis run the tests on the pull request since no new tests are needed). |
Confirming that this is still an open issue as of 4.4.2
|
Should be all good now! :) (in version 4.7.0 forward) |
@heff @gkatsev This still seems to be a problem in 6.10: http://jsbin.com/nuveduhutu/7/edit?html,js,console,output
can we re-open this issue please? |
Right now, videojs seems to add 5 properties to the global object.
Example: http://jsbin.com/izovid/7/edit
Some of these properties are minified by the closure compiler (in the example, "xd", "yd", "pd")
This is problematic for anyone that includes the minified videojs script in a project that has been independently minified with the closure compiler because it is possible that the minified properties collide and overwrite.
Ideally, the library would only touch the global object with the single "videojs" property.
The text was updated successfully, but these errors were encountered: