播放YouTube视频Android的视频略图 [英] Playing Youtube Videos in android with video thumnail

查看:109
本文介绍了播放YouTube视频Android的视频略图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我写一个应用程序,我想以显示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

问候

推荐答案

试试这个:


  1. 从URL解析视频ID:这是URL中的V的参数。即xAiiwSXVRiw在<一个href=\"http://www.youtube.com/watch?v=xAiiwSXVRiw\">http://www.youtube.com/watch?v=xAiiwSXVRiw

获得通过YouTube做为Gdata网址的视频元数据:<一href=\"http://gdata.youtube.com/feeds/api/videos/xAiiwSXVRiw\">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 ='..'&GT; 。 网址属性包含缩略图的网址。

Parse the XML that you get back and look for <media:thumbnail url='..'>. The 'url' attribute contains to the thumbnail url.

这篇关于播放YouTube视频Android的视频略图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆