Jump to content

Video Texture with HTML5 control buttons


Raghavender Mylagary
 Share

Recommended Posts

Hi,

      I am displaying a video onto a plane using the video texture. Now I want to display the HTML5 video controls in the below format. Is there any way I can do it?

I tried to setup the video controls in the below method but its not working

//TV
            var tv = BABYLON.Mesh.CreatePlane("plane", 20.0, scene);
            tv.position.y = 20;
            tv.position.z = 9;

            //TV material and textures
            var mat = new BABYLON.StandardMaterial("mat", scene);
            var mat1 = new BABYLON.StandardMaterial("mat", scene);
            var videoTexture = new BABYLON.VideoTexture("video", [], scene, true, false);
            mat.diffuseTexture = videoTexture;
            tv.material = mat;
            var htmlVideo = mat.diffuseTexture.video;
            htmlVideo.setAttribute("controls", "true");
            htmlVideo.setAttribute("src", "Video3.mp4");

 

Capture.JPG

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...