繁体   English   中英

Three.js:视频纹理NeedsUpdate停止渲染

[英]Three.js: video Texture NeedsUpdate stop rendering

我尝试将视频作为纹理放在网格上,为此,我测试了2种不同的示例:

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

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

两者都可以在网络上按预期工作,但是如果我从本地的github下载它们,它们什么也不会显示。

如果我放

videoTexture.needsUpdate = false;

然后显示楼层和屏幕。 视频可以正常播放,因为我可以听到背后的声音,但没有图像显示。

任何想法如何解决这个问题?

(我已经使用Firefox和Chrome进行了测试)。

编辑:在Firefox的控制台中,我有这个

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

这个问题与我所想的完全不同。

当我从本地文件夹而不是本地服务器运行文件时,出现了“ 同源策略问题”。

如此答案中的解释: https : //stackoverflow.com/a/24042463/1224782

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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