Hi,
here is the link of my work : https://cosmosv1.vercel.app/
My video texture is not playing on mobile, but it works just fine in desktop ?
I have tried lots of things lately, the code might have some stupid mistakes also. As a beginner, please be gentle if I did silly mistake.
here is a video of the situation : Youtube
here is the code of the video :
const video = document.getElementById("cosmosVideo");
video.setAttribute('crossorigin', 'anonymous');
video.playsInline = true;
video.src = "/Model/cosmosVideo3.mp4";
console.log(video)
const videoTexture = new THREE.VideoTexture(video);
videoTexture.needsUpdate = true;
videoTexture.toneMappingExposure = true;
videoTexture.toneMapping = true;
videoTexture.minFilter = THREE.LinearFilter;
videoTexture.magFilter = THREE.LinearFilter;
videoTexture.encoding = THREE.sRGBEncoding;
videoTexture.outputEncoding = THREE.sRGBEncoding;
and here is the code for the loader :
dracoLoader.setDecoderPath(`/node_modules/three/examples/jsm/libs/draco/`);
dracoLoader.setDecoderConfig({ type: "js" });
gltfLoader.setDRACOLoader(dracoLoader);
gltfLoader.load("/Model/cosmossonunda3.gltf", function (gltf) {
cosmos = gltf.scene
gltf.scene.children[1].material.map = videoTexture;
gltf.scene.children[1].material.map.flipY = false;
gltf.scene.children[1].material.map.rotation = Math.PI;
gltf.scene.children[1].material.map.wrapS = THREE.RepeatWrapping;
gltf.scene.children[1].material.map.wrapT = THREE.RepeatWrapping;
gltf.scene.children[1].material.roughness = 0
gltf.scene.children[1].material.lightMapIntensity = 1.3;
scene.add(gltf.scene);
console.log(gltf.scene);
mixer = new THREE.AnimationMixer(gltf.scene);
action = mixer.clipAction(gltf.animations[0]);
console.log(action)