Video Player doesn't recognize direct youtube video links

Hi, I’m using “Youtube Mobile Video Player + Youtube API V3” to generate direct mp4 links to youtube videos
(Like this → https://r6---sn-vgqs7nly.googlevideo.com/videoplayback?dur=269.490&clen=21717932&ratebypass=yes&expire=1482295912&nh=IgpwcjA3Lm9yZDEyKgkxMjcuMC4wLjE&ipbits=0&sparams=clen,dur,ei,gir,id,initcwndbps,ip,ipbits,itag,lmt,mime,mm,mn,ms,mv,nh,pl,ratebypass,requiressl,source,upn,expire&lmt=1459938000259959&requiressl=yes&ei=CLZZWJSrCoPduAL9raTwCQ&source=youtube&initcwndbps=1261250&itag=18&pl=21&ip=173.21.19.206&mm=31&mn=sn-vgqs7nly&gir=yes&id=o-AFOhhd_JQtN2PeNYJKpgOg9-T6VVWiu5QqGe8hV8KIMB&signature=55A879F8F23E946A75B34C008945B080FFF68BB2.03C66B1D7A6AB8DE0D46C661D969172C948B8A70&ms=au&mt=1482274055&mv=m&upn=tFDx3ldnoLo&key=yt6&mime=video/mp4 )
When I set the Unity video player url to the link, set_url returns the error “Can’t play movie”. Is there a way to make unity correctly parse this sort of link, or plans to add support for arbitrary video urls in a future update?
Thanks!

Hi!

The VideoPlayer is currently unable to read directly from YouTube links, but I guess you already found out. However, the link you are giving here will probably work once we fix our URL parsing logic which is a bit too simplistic at this point. Providing a link that ends with .mp4 would work right now and we’ll improve it so it supports the hyperlink having a query string. However, this URL you’re showing us doesn’t even have the .mp4 extension that we’d need in order to steer the stream to the appropriate decoder. We’ll see what can be done… Thanks for bringing this to our attention!

Dominique

1 Like