简体   繁体   中英

Three.js: video Texture NeedsUpdate stop rendering

I try to put a video as a texture on a mesh, for that, I tested 2 differents example:

http://jeromeetienne.github.io/threex.videotexture/examples/videotexture.html

and

http://stemkoski.github.io/Three.js/Video.html

Both works as expected on the web but it doesn't show anything if I download them from github in local.

If I put

videoTexture.needsUpdate = false;

then floor and screen are displayed. The video is working correctly as I can heard the sound behind but no images are displayed.

Any idea how to resolve this problem ?

(I have tested with both firefox and chromium).

Edit: in the console of firefox, I have this

SecurityError: The operation is insecure. Three.js:25696:0
Error: WebGL: The canvas used as source for texImage2D here is tainted (write-only). It is forbidden to load a WebGL texture from a tainted canvas. A Canvas becomes tainted for example when a cross-domain image is drawn on it. See https://developer.mozilla.org/en/WebGL/Cross-Domain_Textures

The problem was completly different than what I thought.

As I was running the file from a local folder and not from the local server, I had the Same-Origin Policy Problem.

As explain in this answer : https://stackoverflow.com/a/24042463/1224782

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM