Quantcast
Channel: Babylon.js
Viewing all articles
Browse latest Browse all 388

Syntax for playing and pausing video textures

$
0
0

Hello,

 

Sorry I've been out for a month - I doubt anyone missed me.  :(  I had to travel to Thailand (my Wife is Thai) for personal family issues which will take me back to Thailand on the 24th.  So I had to put my multiuser real time drawing app on hold.  But now I want to complete the first version in the next week, and am really stuck on something today.

 

I have buttons that send the correct values to my conditional statements, but I don't know what the operation or proper syntax is to play and pause a video texture within my conditions.  I must be missing something as this doesn't seem that difficult.

 

I can certainly get these statements to cause a play or pause operation:

videoTexture.video.play();

videoTexture.video.pause();

but only once in my scene and not in a conditional statement.

 

 

I assume I must be missing further declaration - potentially for the object the video is playing attached as a diffuse video texture. Perhaps something similar to:

scene.getMeshById("mymesh").visibility = 0;

to set visibility and other attibutes for an object.

 

I often use for a simple switch:

plane.actionManager = new BABYLON.ActionManager(scene);
plane.actionManager.registerAction(new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnPickTrigger, function () {
videoTexture.video.pause();
}));

but certainly remark this out as in this case it might cause a conflict with my conditions.  So how might I pause and play a video texture in a conditional statement?

 

As always, your help is greatly appriciated.

 

Cheers,

 

DB

 

 

 

 


Viewing all articles
Browse latest Browse all 388

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>