I'm trying to render Youtube video onto Unity3d texture, through a plugin for Android.
1) Android MediaPlayer API can render video streaming with specific url onto a texture. But there's no official method to reveal streaming urls for Youtube videos.
2) YoutubePlayerView class in Youtube API lets me ignore how to play Youtube videos, but there's no way to render any Android View including YoutubePlayerView onto a Unity3d texture. (I succeeded to render a WebView onto another SurfaceView, but when load Youtube iframe source onto the WebView, video is not rendered to another one; Youtube Player UI components were rendered.)
Is there anyone have some idea to solve? Any kind of workaround will be ok.
I was doing something like this with augmented reality. In my case I used a normal video player which you can play video files in a texture. What i did was use the direct link for the youtube video file (not youtube URL) instead of a local file link and it worked.
So you have to found the link to the youtube video file. It's easy with some libraries that you can find on internet. Also you can develop a web scraper to find it in the youtube URL html but its a more complicated option.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With