Hello,
I am trying to use VideoTexture with a webm video. But iOS doesn’t seem to support webm so I am going to use a .mov file instead. Here is my React Three Fiber code:
function Plane() {
const [video] = useState(() => {
const vid = document.createElement("video");
vid.crossOrigin = "Anonymous";
vid.loop = true;
vid.muted = true;
vid.autoplay = true;
const mov = document.createElement("source");
mov.src = "./bounce.mov";
mov.type = "video/quicktime";
vid.appendChild(mov);
return vid;
});
useEffect(() => void video.play(), [video]);
return (
<mesh>
<planeGeometry args={[3, 3]} />
<meshBasicMaterial
side={THREE.DoubleSide} //
transparent
>
<videoTexture
format={THREE.RGBAFormat} //
encoding={THREE.sRGBEncoding}
attach="map"
args={[video]}
/>
</meshBasicMaterial>
</mesh>
);
}
But nothing appears. When I replace the file path with ./bounce.webm
it works perfectly fine.
Any ideas how to get MOV working with VideoTexture?