title: Use YouTube video for webgl texture?
body: <p>I'm trying to use a youtube video as a webgl texture and at the moment I can't make it work because of a few issues. Does anyone have any experience with doing this and can point me in the right direction/tell me its not possible?</p>
  
  <p>I'm following the approach detailed here : <a href="https://developer.mozilla.org/en/webgl/animating_textures_in_webgl" rel="nofollow">https://developer.mozilla.org/en/webgl/animating_textures_in_webgl</a> where basically you make a texture from a html5 video element and keep reading frames into a texture used in your scene. This works really well for normal videos, but youtube will only provide (AFAIK) html5 video via an iframe, which is obviously on their domain rather than mine. This means its hard to query the iframe for the video element to use as a texture (my quick attempt at proxying this doesn't work because the iframe src uses relative urls, though I didn't try this thoroughly). I also tried using mediaElement.js to wrap the element as html5 video(like this : <a href="http://mediaelementjs.com/examples/?name=youtube" rel="nofollow">http://mediaelementjs.com/examples/?name=youtube</a>)  though I quickly realised that this is only a facade so doesn't really work as input for the texture (atleast I think that's the issue!).</p>
  
  <p>I don't want to do anything that involves downloading and re-encoding the YT video or anything along those lines as I need something that can be done programatically, though either client or server side is fine.</p>
  
  <p>I'm pretty sure the problem is just getting hold of a video element that contains the youtube video, but I'm pretty new to webgl, and totally new to video in webgl, so open to any ideas there! All help gratefully received - thank you!</p>