How to display thumbnail of YouTube Videos in Android

前端 未结 5 2178
野的像风
野的像风 2020-12-07 23:42

I writing an app where i want to display a list of YouTube videos. But I want the list to display the video title with some other info but also show a thumbnail of the video

5条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-08 00:11

    Try this:

    1. Parse video ID from the URL: this is the 'v' parameter in URL. I.e. 'xAiiwSXVRiw' in http://www.youtube.com/watch?v=xAiiwSXVRiw

    2. Get the video metadata via Youtube Gdata URL: http://gdata.youtube.com/feeds/api/videos/xAiiwSXVRiw

    3. Parse the XML that you get back and look for . The 'url' attribute contains to the thumbnail url.

提交回复
热议问题