Android Java Youtube API v3.0 Get RTSP Video Link

I want to play youtube video on Surface using MediaPlayer .
So, I have to put a direct video link there.
The problem is this: how to get this link on an Android device?

The link is as follows: http://gdata.youtube.com/feeds/api/videos/VIDEO_ID
No longer available. Probably due to the old and deprecated API v2.0 .
But this web service somehow does the trick.
And the link to the result works fine. So it is possible.

+5
source share
1 answer

Try 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 it using HttpGet, extract the RTSP URLs from this informational answer.

change

You can use this link to extract RTSP links https://github.com/flipstudio/YouTubeExtractor/blob/master/src/main/java/com/flipstudio/youtube/extractor/YouTubeExtractor.java

change

Much has changed, please use this project to correctly extract https://github.com/HaarigerHarald/android-youtubeExtractor/blob/master/youtubeExtractor/src/main/java/at/huber/youtubeExtractor/YouTubeExtractor.java

+8
source

All Articles