0

I want to be able to do this

<a-videosphere src="https://www.youtube.com/watch?v=diBozKDxVLI" autplay="true"></a-videosphere>

Is there any way I can without pointing to a locally stored file?

Yoni Binstock
  • 241
  • 4
  • 19

2 Answers2

1

You can't render a YouTube video as a texture in WebGL. YouTube does not offer an URL to extract the video source. The official player is the only way they have to place ads and monetize the service. If you could stream a video directly you would be able to freely redistribute YouTube content. Technically, it's possible to create a web service that downloads YouTube videos and expose them through a streaming endpoint but it will go against the terms of service:

https://www.youtube.com/static?template=terms

Diego Marcos
  • 4,502
  • 3
  • 15
  • 20
1

https://aframe.io/faq/#can-i-render-youtube-videos-as-a-texture

With some manual effort, you could either proxy YouTube videos as a texture or download them locally to serve, but that is against their terms of service.

ngokevin
  • 12,980
  • 2
  • 38
  • 84
  • My video files are too big to store on github, so can't store it locally. I keep seeing "proxy YouTube videos as a texture", but haven't seen how you can do that. Any ideas? – Yoni Binstock Jul 18 '16 at 23:37
  • Check out https://github.com/cvan/webvr360 for proxying. Check out https://aframe.io/aframe/examples/_uploader/ for storing the videos. – ngokevin Jul 19 '16 at 01:12