I am trying to play youtube video in exoplayer but here is some confusion i do't know what is DASH url, i have only real youtube url like "https://www.youtube.com/watch?v=v1uyQZNg2vE" , i have no idea how to generate dash url form real url.
Dash Url:
new Sample("Google Glass",
"http://www.youtube.com/api/manifest/dash/id/bf5bb2419360daf1/source/youtube?"
+ "as=fmp4_audio_clear,fmp4_sd_hd_clear&sparams=ip,ipbits,expire,as&ip=0.0.0.0&"
+ "ipbits=0&expire=19000000000&signature=255F6B3C07C753C88708C07EA31B7A1A10703C8D."
+ "2D6A28B21F921D0B245CDCF36F7EB54A2B5ABFC2&key=ik0", DemoUtil.TYPE_DASH),
Real Url :
https://www.youtube.com/watch?v=v1uyQZNg2vE
I've written a class that retrieves actual YouTube video streaming URL for format like DASH and HLS using http://www.youtube.com/get_video_info?&video_id=[video_id]&el=info&ps=default&eurl=&gl=US&hl=en url with video ID as described by Karim Abdell Salam. I have also tested the URL in an app that uses ExoPlayer and it works:
Here is the test code:
You will have to get the HTTP response from the youtube URL (in your case real URL) and then search for the section "url_encoded_fmt_stream_map". In that section you will get a URI which needs to be decoded twice to get the DASH URL you are looking for.
to play youtube video in exoplayer we can use this library
and simply get the url like this and then play in exoplyer
I had the same issue but i finally found the simplest solution and its working so good
First you need to call this url..
HTTP GET: https://www.youtube.com/get_video_info?&video_id=[video_id]&el=info&ps=default&eurl=&gl=US&hl=en
and don't forget to change the last id with the target one.
-just paste your data and press decode a several times to ensure it decoded well
finally search for a key called dashmpd and enjoy ur URL