Jump to content

Playing video on a plane


saifshk17
 Share

Recommended Posts

Hello people,

I am able to play a video on Plane but unfortunately the video seems to be mirrored, as in flipped. What am I doing wrong in my script? 

Also, how do I make sure that the video starts playing once the page loads?

            var ANote0 = BABYLON.MeshBuilder.CreateBox("ANote0", { width: 140, height: 90, depth: 0.100000 }, scene);
            ANote0.position = new BABYLON.Vector3(180, 30, -425);

            
            var mat = new BABYLON.StandardMaterial("ANote0Mat", scene);
            mat.diffuseColor = new BABYLON.Color4(0, 0, 0, 1);
            ANote0.material = mat;
            var planeOpts = {
                height: 90,
                width: 140,
                sideOrientation: BABYLON.Mesh.BACKSIDE
            };
            var ANote0Video = BABYLON.MeshBuilder.CreatePlane("plane", planeOpts, scene);
            var vidPos = (new BABYLON.Vector3(0, 0, 0.1)).addInPlace(ANote0.position);
            ANote0Video.position = vidPos;


            var ANote0VideoMat = new BABYLON.StandardMaterial("m", scene);
            var ANote0VideoVidTex = new BABYLON.VideoTexture("vidtex", "videos/screencast.mp4", scene);
            ANote0VideoMat.diffuseTexture = ANote0VideoVidTex;
            ANote0VideoMat.roughness = 1;
            ANote0VideoMat.emissiveColor = new BABYLON.Color3.White();
            ANote0Video.material = ANote0VideoMat;
            ANote0VideoVidTex.video.play();

            scene.onPointerUp = function () 
            {
                        ANote0VideoVidTex.video.play();

            }

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...