Error to play video in a mesh

Hi everyone, I’m having a problem playing a video in a mesh.

The following error occurs: DOMException: play() failed because the user didn’t interact with the document first.

I think it’s a browser error and to do with autoplay policy. But I already gave the video.muted = true and even then it doesn’t run.

I followed this playground:

Hi VictorBwD,

What browser is this on? Different browsers have different policies about autoplaying videos, and I think some may disallow it entirely. Can you add an interaction prompt to your experience so that your page gets permission to play the video?

1 Like

it’s in Chrome. How do I do this?

I can play videos in modals, but autoplay doesn’t want to work on mesh.

Is this Chrome on Android, iOS, Windows, or a different platform? The Playground you linked to works as expected for me on Chrome on both Windows and Android; do you have a repro of the specific situation you’re encountering?

1 Like


Here is the mesh i want to put the video on.

And here the code.

It’s all I have to show…

The video is black, the mesh starts black like the video, but the video doesn’t start.

Could you try to add:

materialVideo.emissiveTexture = videoTexture;

Also, to check if video is really playing (it may be just invisible for some reasons), add


and have a look at the console.

1 Like

This shows on console every 1 second. Zero. Does that mean the video is not playing?

And here the error…

Did not work with emissiveTexture.


Did you interact with canvas somehow, as it is written in the warning message?

It will not work because video is not playing.

Check if video is really muted.
If nothing helps, put video on pause first, then play on canvas click.

This article may put some light - Autoplay policy in Chrome - Chrome Developers


Can you try passing the settings to the videoTexture constructor ???

new BABYLON.VideoTexture("vidtex","textures/babylonjs.mp4", scene, undefined, undefined, undefined, {
        autoPlay: true,
        muted: true,
        loop: true,
        autoUpdateTexture: true,

Thank you so much! And to everyone who responded.

It worked!

1 Like