我写一个应用程序,我想以显示YouTube视频列表。但我想在列表中显示其他一些信息的视频标题也显示视频的缩略图,当我们去像它www.youtube.com
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 like it does when we go www.youtube.com
一些能帮助我如何显示缩略图的视频网址上
Can some help me please on how to display the thumbnail for a video URL
问候
试试这个:
从URL解析视频ID:这是URL中的V的参数。即xAiiwSXVRiw在http://www.youtube.com/watch?v=xAiiwSXVRiw
获得通过YouTube做为Gdata网址的视频元数据:http://gdata.youtube.com/feeds/api/videos/xAiiwSXVRiw
Get the video metadata via Youtube Gdata URL: http://gdata.youtube.com/feeds/api/videos/xAiiwSXVRiw
解析你回来,寻找&LT XML的代码;媒体:缩略图URL ='..'>
。 网址属性包含缩略图的网址。
Parse the XML that you get back and look for <media:thumbnail url='..'>
. The 'url' attribute contains to the thumbnail url.