Jump to content

Error while Loading an Video in a Texture

Raghavender Mylagary

Recommended Posts

Well, there is an error "while trying to load texture: SampleVideo.......mp4". The call stack there will probably get you going.

Maybe the file isn't there, maybe your server refuses this mime type, maybe the file is on a non-cors-enabled server, maybe it should be Samplevideo and not SampleVideo.

So many reasons! :)

Open the stack on the error, try debugging this.

Looking at your .babylon file - the problem is that you try loading a video as the image of a regular diffuse texture. You will need to write some lines of code loading a video texture from the file you defined. As far as I know, the .babylon scene file doesn't support Video Textures.

Link to comment
Share on other sites

@Raghavender Mylagary : I know that Blender allows you to load a texture that is an "image or movie" but the exporter thinks you are using an image.

As @RaananW you need to specifically set up the video as a certain type of texture (a VideoTexture) in code like :

screen.material.diffuseTexture = new BABYLON.VideoTexture("video", ["babylonjs.mp4", "babylonjs.webm"], scene, true);

and then you have access to play, pause, loop, autoplay etc. See link below under video.

Advanced Texturing

cheers, gryff :)

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.

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.


  • Recently Browsing   0 members

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