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: implement touch pan controls again #89

Merged
merged 1 commit into from
May 23, 2018
Merged

Conversation

brandonocasey
Copy link
Contributor

@brandonocasey brandonocasey commented May 17, 2018

Description

Recently webvr-polyfill removed support for the touch panner controls that they used to add to their polyfill vr headset. This PR brings them back.

Testing

  • Make sure that the latest versions of every browser can move around the video with touch controls or mouse
    • iOS Safari
    • Android Chrome
    • Safari
    • Chrome
    • Firefox
  • Make sure that mobile browsers can move around the video by physically moving the phone:
    • iOS Safari
    • Android Chrome

// expose private functions so that users can manually use controls
// and we can add orientation controls
if (m === 'OrbitControls') {
code = globalReplace(code, 'function rotateLeft\\(', 'rotateLeft = function(');
Copy link
Contributor Author

Choose a reason for hiding this comment

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

A somewhat hacky patch to OrbitControls to allow us to modify the movement a bit so that we can add on the movement from DeviceOrientationControls. I felt like this was a better alternative to Grabbing the code, storing it in our repo, and maintaining these small modifications.

@ishita12
Copy link

QA LGTM

@brandonocasey brandonocasey merged commit 0cde016 into master May 23, 2018
@brandonocasey brandonocasey deleted the fix/touch-pan branch May 23, 2018 19:59
@danielgroppo
Copy link

Hello,

Sorry or my newbie question, I'm little bit confused how to make it works (movement with the mouse/touch). I incorporated the videojs-vr.min.js script to my page and the player worked perfectly with gyroscope. If I just add the plugin.js and the movements will work? What files should I complement?

Again, apologies for the rookie question, feel free to delete if you are in the wrong place. Thank you for this great project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants