Hello everyone, I am a beginner. I have initially implemented video texture playback through forum tutorials. When testing on the desktop, it can play normally after clicking the button.
But after entering VR, using the handle to click the button cannot play the video.
I also encountered a similar question raised by this post. The answer seems to involve Input controls. How to integrate these codes?
Hi all,
I have built ui components with hover events. These are using mouse event listeners. Mainly click, mouseenter and mouseleave.
Obviously everything is working when I test it on desktop using my mouse. But when I test it on my Quest 2 the events don’t trigger. Makes sense, I guess.
What I am looking for are the equivalent event listeners of mouseenter and mouseleave for VR controllers.
I could not find them online and am wondering if they exist.
Could anybody point me in the right dir…
My unfinished project address is
https://playcanvas.com/project/1155224/overview/vr-videotexture
The requirement is to click the Play button to play the video in VR and click the Stop button to stop playing the video.
Can anyone help solve these problems? Thanks
Ramon
October 25, 2023, 7:40am
2
Hi @cyhunter_cy ,
The play button works fine for me. Even in XR.
To pause the video you could add another attribute to link your stop button entity.
VideoTexture.attributes.add('stopButtonEntity', {
title: 'Stop Button Entity',
type: 'entity'
});
Then add this to your VideoTexture initialize.
var stopButton = this.stopButtonEntity.button;
stopButton.on('click', function(e) {
video.pause();
console.log("video paused");
}, this);
Thank you very much, the code works
1 Like