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

fix: use player resize/fullscreenchange events which are more consistent #2

Merged
merged 2 commits into from
Jul 27, 2017

Conversation

brandonocasey
Copy link
Contributor

@brandonocasey brandonocasey commented Jul 27, 2017

Verified on Chrome, Safari, Firefox, Edge, and Android Chrome

src/plugin.js Outdated
@@ -364,8 +364,7 @@ const vr = function(options) {
camera.updateProjectionMatrix();
}

window.addEventListener('resize', onWindowResize, false);
window.addEventListener('vrdisplaypresentchange', onWindowResize, true);
player.on(['resize', 'fullscreenchange'], onWindowResize);
Copy link
Member

Choose a reason for hiding this comment

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

the resize event means that the video has changed resolution. We don't currently have an event for the player changed size other than fullscreenchange, I don't think.

We probably still want to listen to resize and vrdisplaypresentchange on window. At least the vrdisplaypresentchange.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I guess there isn't any harm in listening to all of these events (minus resize on player)

@brandonocasey brandonocasey force-pushed the fix/safari-fullscreen-toggle branch from 0e4a070 to 78782ff Compare July 27, 2017 20:47
@brandonocasey brandonocasey merged this pull request into master Jul 27, 2017
@brandonocasey brandonocasey deleted the fix/safari-fullscreen-toggle branch July 27, 2017 21:54
kevleyski referenced this pull request in kevleyski/videojs-vr Dec 20, 2022
[KJSL] Swap webvr ro webxr polyfill packages
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.

2 participants