What is the correct syntax to pause a video on a 360 3D VideoDome in immersive mode? I have a 3D video on a VideoDome that works. I want to pause, and restart it, and check its status. I can’t seem to get the syntax exactly right.
I have
var Dome = new BABYLON.VideoDome
(
"videoDomeZ",
[vid],
{
resolution: 32,
clickToPlay: true,
mesh: planeZ,
},
scene
);
Dome.videoMode = BABYLON.VideoDome.MODE_SIDEBYSIDE;
That works, and I seem to be able to check the status with Dome.videoTexture.video.paused.
But I can not seem to pause it with Dome.videoTexture.video.pause().
Do I need to extract the videoTexture (or VideoTexture?) from the Dome. I’m not sure what the syntax is. I can guess that it might be something like…
var texture = Dome.getVideoTexture() (or something like that)
texture.video.pause();
Will the correct syntax pause both the video and the audio or must they be paused independently?
After a lot of research, it appears the problem may be that although the video can be paused in POINTERDOWN while the trigger is pulled, after the trigger is released it begins to play again whether or not there are commands in POINTERUP.
When a POINTERDOWN is triggered, the video in the Dome pauses WHILE the trigger is held down. The Dome.videoTexture.video.paused boolean correctly says TRUE.
However, when the trigger is released, even if there is a Dome.videoTexture.video.pause() in TRIGGERUP, the video starts playing again; the Dome.videoTexture.video.paused boolean still correctly says TRUE.
It does not matter whether or not there is a mesh – so this problem exists in XR (at least) for both 3D framed SBS and 2D MONOSCOPIC VideoDome videos.
This shows the problem in the Playground whether viewed on a computer or viewed in 3D with a QUEST. The issue must be solved in all the ways it can be viewed.
clickToPlay seems to mean more-or-less the opposite of what I thought it meant. (But I’ve never found a definition.) What exactly is the meaning of clickToPlay? What does it do when true? when false?
Since changing clickToPlay to false seems to work (thanks, Sebavan!), it is not of critical importance, but I do not understand why clickToPlay = true should “disable” POINTER UP from allowing a pause.
How did you know the solution? From experience? Or is there some relevant documentation or example? I keep looking for helpful documentation and examples.
This looks like a bad logical or strategic decision in the design or in the naming. There is no deliberate click for the purpose of playing, here (which is how it seems most simple to understand “clickToPlay”. This shows part of what I surmised: As you say, it seems to say that no matter what you tell Dome on POINTER DOWN (even unrelated to play/pause) the video should start to play when the POINTER goes UP.
But that still leaves open the question of why Dome.videoTexture.video.paused shows true even after this plays the video.
I’m guessing you found this in github, since my tries at finding this with Google searches didn’t work, and I’m not skilled at finding code within github. How did you locate this fragment? There is a ton of code for Babylon and I find it hard to navigate thru it.
I wish I had started searching for and reading Babylon code in VSCode much sooner, it’s so much nicer than using GitHub for that, which I did for a long time LOL…