Android Java Youtube API v3.0 get video RTSP link

前端 未结 1 1908
不思量自难忘°
不思量自难忘° 2021-01-18 11:26

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

相关标签:
1条回答
  • 2021-01-18 12:12

    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

    0 讨论(0)
提交回复
热议问题