Skip to content
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

Don't use minifiable player methods in fullscreenToggle #851

Closed
wants to merge 6 commits into from

Conversation

dmlap
Copy link
Member

@dmlap dmlap commented Nov 26, 2013

Use string literals to lookup fullscreen-related methods on the player object in the fullscreenToggle component. Otherwise, closure compiler replaces them with minified method names and makes it impossible to supply a simpler "player" object with customized fullscreen logic for the fullscreenToggle to interact with.

This PR includes a typo fix and the changes from Pull #850. I can open a clean PR if those changes require re-think.

If the video element has a id attribute when video.js was created, it used that as the player id. If the video did not have an id, however, the player would get an auto-generated component id that started with "undefined_..." and the player element received a id like "vjs_video_...". This change modifies the player init order so that the video element is given an autogenerated id early in the process, which is then picked up by the player component when it gets around to initialization. This unifies the player component id and tag id and is more consistent with the structure created when a video element with a user-defined id is passed in.
Remove qunit files directly from the repo and use npm to load them instead. Add the qunit-toolbar to test runner pages so you can run tests without the "helpful" try-catch blocks inside the browser.
availble -> available
Use string literals to lookup fullscreen-related methods on the player object in the fullscreenToggle component. Otherwise, closure compiler replaces them with minified method names and makes it impossible to supply a simpler "player" object with customized fullscreen logic for the fullscreenToggle to interact with.
@@ -23,11 +23,11 @@ vjs.FullscreenToggle.prototype.buildCSSClass = function(){
};

vjs.FullscreenToggle.prototype.onClick = function(){
if (!this.player_.isFullScreen) {
this.player_.requestFullScreen();
if (!this.player_['isFullScreen']) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

meh. At least it'll work now.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may fix that iOS fullscreen control issue (I forget the issue number offhand) but my actual use-case is for custom controls during ad playback.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, just don't like that we had to do this whole string thing.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that's ugly. I actually think we could set up an externs file for the player like we do with Flash.
https://github.com/videojs/video.js/blob/master/src/js/media/flash.externs.js

Externs are meant for external projects, but we're running into inter-component issues here, and I think it would avoid the duplicate methods that exporting creates. Want to try that?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Opened an externs-based PR: #853

Instead of using string literals, create an externs file for the player and use that to ensure fullscreen functionality is never minified.
@dmlap
Copy link
Member Author

dmlap commented Nov 26, 2013

Bad merge. I'll re-open a clean PR.

@dmlap dmlap closed this Nov 26, 2013
@dmlap dmlap deleted the hotfix/internal-fullscreen-apis branch November 26, 2013 23:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants