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

Proxy ios webkit events into fullscreenchange #3644

Merged
merged 5 commits into from
Sep 29, 2016

Conversation

gkatsev
Copy link
Member

@gkatsev gkatsev commented Sep 26, 2016

Description

Previously, the ios webkit events (webkitbeginfullscreen and
webkitendfullscreen) were only proxied into the fullscreenchange event
when requestFullscreen was called directly. So, on iPhones, we would
never be able to get this event. This makes it so these events are
always proxied.

Requirements Checklist

  • Feature implemented / Bug fixed
  • If necessary, more likely in a feature request than a bug fix
  • Reviewed by Two Core Contributors

@gkatsev
Copy link
Member Author

gkatsev commented Sep 26, 2016

This is failing the test due to the firefox issue which is fixed here

@gkatsev gkatsev modified the milestones: 5.13, 5.12 Sep 27, 2016
};

this.on('webkitbeginfullscreen', webkitbeginFn);
this.on('dispose', () => this.off('webkitbeginfullscreen', webkitbeginFn));
Copy link
Contributor

@brandonocasey brandonocasey Sep 27, 2016

Choose a reason for hiding this comment

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

I don't think webkitendfullscreen will be disposed correctly if we dispose the player while in full screen for some reason

Copy link
Member Author

Choose a reason for hiding this comment

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

Yup, you're correct. I'll update it.

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated.

Copy link
Member Author

@gkatsev gkatsev left a comment

Choose a reason for hiding this comment

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

@brandonocasey if you can take another look now, that would be great

* @method proxyWebkitFullscreen_
*/
proxyWebkitFullscreen_() {
if ('webkitDisplayingFullscreen' in this.el_) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I would do if (!'webkitDisplayingFullscreen' in this.el_) if that works and return at the top

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, that would be a bit nicer.

this.on('webkitbeginfullscreen', beginFn);
this.on('dispose', () => {
this.off('webkitbeginfullscreen', beginFn);
this.off('webkitendfullscreen', endFn);
Copy link
Contributor

Choose a reason for hiding this comment

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

will this trigger an error if we are not in full screen? aka this.one('webkitendfullscreen', endFn); is already triggered and gone or was never added in the first place(in the case of never going to full screen)

Copy link
Member Author

Choose a reason for hiding this comment

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

Nope, neither of these should error out if it's already been removed.

Previously, the ios webkit events (webkitbeginfullscreen and
webkitendfullscreen) were only proxied into the fullscreenchange event
when requestFullscreen was called directly. So, on iPhones, we would
never be able to get this event. This makes it so these events are
always proxied.
@gkatsev
Copy link
Member Author

gkatsev commented Sep 29, 2016

I've made the nesting change. I've also rebased against master, so, hopefully, the tests will pass without the firefox issue.

Copy link
Contributor

@brandonocasey brandonocasey left a comment

Choose a reason for hiding this comment

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

LGTM

@gkatsev gkatsev merged commit e479f8c into videojs:master Sep 29, 2016
@gkatsev gkatsev deleted the proper-ios-fullscreenchange branch September 29, 2016 18:35
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