Three.js: video Texture 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 和 chromium 都测试过)。

编辑: 在 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

问题跟我想的完全不一样

因为我是 运行 来自本地文件夹而不是来自本地服务器的文件,所以我遇到了 Same-Origin Policy 问题。

如本回答中所述: