Documentation on enabling mouse movement to pan video?
wadehammes opened this issue · 8 comments
Right now you have to click to move video, I would like to be able to pan the video to the right if mousing to the right, and vice versa. I see a Pointer control in the index.html but that hides the cursor, and can't figure out how to get the cursor to stay but have the panning effect. Any help is appreciated!
@wadehammes try frame.controls.movement.enable();
@jwerle thanks! Still not working though. Everything works but the mouse panning...here is my JS:
/*
* Initial AXIS element
*/
var frame = new Axis(document.querySelector('#video'), {
src: '/wp-content/themes/base/library/video.mp4',
crossorigin: true,
resizable: true,
preload: true,
autoplay: true,
muted: true,
width: window.innerWidth,
height: window.innerHeight,
loop: true
});
// Render the video player
frame.render();
// Once Rendered, set up environment
frame.once('ready', function () {
frame
.focus()
.seek(5)
.play()
.projection('equilinear')
.rotate('y', {value: 0.01, every: 200})
.controls.movement.enable();
});
Any thoughts? I also tried to move the .controls.movement.enable()
out to its own line like .render()
with no such luck. No console errors.
@wadehammes oops! Try disabling the mouse too with frame.controls.mouse.disable();
@jwerle still nothing unfortunately. You can view my sandbox here: http://experius.com/video-test/
I really appreciate the help, seems like it's probably something dead simple.
Actually it appears to work but only when you click, is there an easy way to adapt this to hover?
@wadehammes are you tying to take control of the mouse? Do you want the orientation to change without clicking?
@jwerle - I just want to be able to pan around the video while hovering on the left, right, top, bottom of the screen - like seen here: https://www.felixandpaul.com/?projects/intro
@wadehammes ah I see! That is currently not supported. However, we'd happily accept a PR if you'd like to contribute. Pointer lock is likely the best way to get the functionality you seek out of the box.