I am trying to use a streamed video as texture in my webGL scene, using three.js and threex.videoTexture.
I understand the reasoning of blocking cross origin resources and after a lot of researching I have managed to get it to in an html5 video tag :) by setting up the proxy settings in my apache server.
However, even though I can see the video playing in the Html5 video tag, when I apply the video as a texture in webGl I get the following error:
Uncaught SecurityError: Failed to execute 'texImage2D' on 'WebGLRenderingContext': The video element contains cross-origin data, and may not be loaded.
I do hear the sound of the video, but I do not see the video on the object.
The working html5 video tag does not have the crossorigin parameter set to "anonymous" but it still works. When I add the crossorigin parameter on the video element I am using in webGL, I do not receive the error, but I don't hear the sound nor see the video
I would really appreciate any suggestions! TIA!
The code I am using has been taken from this tutorial: http://learningthreejs.com/blog/2014/04/30/easy-way-to-integrate-video-or-even-webcam-in-your-texture-with-threex-dot-videotexture-game-extension-for-three-dot-js/
EDIT: This is what I added to the httpd.conf to configure the proxy settings:
ProxyRequests On
ProxyVia On
ProxyPreserveHost On
<Proxy *>
Order allow,deny
Allow from all
</Proxy>
# VLC server stream
ProxyPass /desktop.ogg http://localhost:8081/desktop.ogg
ProxyPassReverse /desktop.ogg http://localhost:8081/desktop.ogg
This is my htm5 video tag (working):
<video id="video" src="http://localhost:8081/desktop.ogg" autoplay>
Your browser doesn't appear to support the HTML5 <code><video></code> element.
</video>
<video id="video" src="http://localhost/desktop.ogg" autoplay>? (assuming you're running Apache proper and not some development envirnoment version... if not, you need to use it's port, not the port VLC set up, if I can remember what VLC does...) - JayC