const video = document.getElementById("video");
video.setAttribute("crossorigin", "anonymous");
video.play();
However, the plane is just a big piece of black cutting my cube in the corner, and doesn’t have a video playing. I’ve already tried loading the video separately with video.src="https://cdn.glitch.com/f702252a-b636-466f-bffb-ccb9405c2c77%2F4k_6.mp4".
I need the cross-origin thing because if you remove it, you get an error that THREE.WebGLState: DOMException: Failed to execute 'texImage2D' on 'WebGL2RenderingContext': The video element contains cross-origin data, and may not be loaded.at Object.texImage2D
Any ideas how I change this? If you load the site at https://threejs-lets-go.glitch.me and delete the canvas and display the video, you’ll see that the video playing. Thanks in advance for helping!
This URL doesn’t load for me. I’m not familiar with how assets work in glitch, are you supposed to reference it as src="/assets/4k_6.mp4"? Although that doesn’t work either
Odd - I asked the Glitch community about this error. If my source is randomly nonexistent that might cause the video not to play… but the video is playing anyway if I remove the threejs canvas. Any other ideas what’s not causing this to play?
Oh also some extra information: if video.setAttribute("crossorigin", "anonymous"); or crossorigin="anonymous" aren’t in the code, then the console will throw errors. But my video is still failing to play!!
I SOLVED IT!! The solution was that my light was shining black lol. I was changing the color of my light, and it turns out you can only see things with a white colored light… duh.
Thanks to your post I was able to fix my video playback lol
The documentation is pretty hard for me as a novice and i am just copy pasting code from everywhere