-
Notifications
You must be signed in to change notification settings - Fork 145
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: player controls #96
Conversation
@@ -39,6 +39,11 @@ export default function(options) { | |||
|
|||
code = globalReplace(code, 'rotateLeft', 'scope.rotateLeft'); | |||
code = globalReplace(code, 'rotateUp', 'scope.rotateUp'); | |||
// comment out the context menu prevent default line... | |||
code = globalReplace(code, | |||
"scope.domElement.addEventListener\\( 'contextmenu'", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comments out https://github.com/mrdoob/three.js/blob/dev/examples/js/controls/OrbitControls.js#L226 so that we don't preventDefault on the contextmenu. It makes sense to do this if you are using pan controls with right click, but we are not.
c72450e
to
8ace4ad
Compare
QA LGTM |
|
||
onMoveStart(e) { | ||
|
||
// if the player does not have a controlbar or |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this use Video.js's tap
event?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let me see if that works, looks like its probably a better solution.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK so I think that it would be too large of a refactor to convert this to a component and use the tap event. I think this will have to happen in another pr.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sounds good.
// video.js listens for user activity on the video element | ||
// and makes the user active when the mouse moves. | ||
// We don't want that for 3d videos | ||
this.oldReportUserActivity = this.player.reportUserActivity; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not a huge fan of these but I don't think there's currently a way to disable it. Maybe we should have one?
Though, I guess this is also fairly self-contained and restores it on dispose.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I thought about adding one, but it seems like this plugin would be the only use case.
@@ -497,7 +498,9 @@ class VR extends Plugin { | |||
canvas: this.renderedCanvas, | |||
orientation: videojs.browser.IS_IOS || videojs.browser.IS_ANDROID || false | |||
}); | |||
this.canvasPlayerControls = new CanvasPlayerControls(this.player_, this.renderedCanvas); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we add this as a child of the player rather than just instantiating it here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh, it's not a real component, just an object.
Fixes #92
Right now its now a lot of the default player behaviors are overridden by the other controls. This pr brings them back and makes them work how we would expect.
right click
should show up.