Playing videos in Chrome

Hi,

I.m using a video texture in THREE as a windscreen in a flight simulator to simulate rain falling on the windshield.

All is fine in Firefox and Edge, but in Chrome the video does not play.

This is the video element

<video id="video" type="video/webm"  muted loop autoplay width="512" height="512" src="rain_on_glass.webm" style="display: none;"></video>

Can you advise what is needed in Chrome to auto play the video ? I don’t want users to have to press a button to play it.

Chrome version is 87

thanks.

Steve

I don’t think it’s possible to autoplay a video in Chrome, that’s their policy. If you look at the video texture example, the code is initiated by a user event, it’s because browsers don’t want you to play audio and videos without user consent.

Alternatively you could render droplets in screen space with an orthographic camera

It is possible but the audio has to be muted like in the following example:

https://threejs.org/examples/webgl_video_panorama_equirectangular

2 Likes