I want to play youtube video on Surface
, using MediaPlayer
.
So, I should put there direct video link.
Problem is: How to get this link on A
Try with this url
String ytInfoUrl="http://www.youtube.com/get_video_info?video_id=" + youtubeID + "&eurl="
+ URLEncoder.encode("https://youtube.googleapis.com/v/" + youtubeID, "UTF-8");
Open this using a HttpGet extract the RTSP urls from that info response.
edit
You can use this link for extracting the RTSP links https://github.com/flipstudio/YouTubeExtractor/blob/master/src/main/java/com/flipstudio/youtube/extractor/YouTubeExtractor.java
edit
A lot have been changed please use this project for proper extraction https://github.com/HaarigerHarald/android-youtubeExtractor/blob/master/youtubeExtractor/src/main/java/at/huber/youtubeExtractor/YouTubeExtractor.java