如何在Android列表中获取YouTube视频的视频缩略图 [英] how to get video thumbnail of youtube video in android list in android

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

问题描述

我正在开发一个应用程序,我想在其中显示一个列表,其中包含youtube视频的网址.我已成功显示列表,但问题是我无法显示视频缩略图.

I am developing an application where I want to show a list which contains urls of youtube video. I am succeeded in showing list but problem is I am unable to show video thumbnail.

如何以编程方式创建youtube视频缩略图.

How to create youtube video thumbnail programatically.

谢谢

-Hiren Dabhi提供了我现在正在使用的解决方案&解决了问题

Edited:-- Hiren Dabhi give solution which I am using now & it solved problem

谢谢

推荐答案

无法获得YouTube视频的直接缩略图,因为实际上它会重定向URL.如果您的URL是直接视频URL,则只有您可以获取该视频的缩略图.

It is not possible to get a direct thumbnail of YouTube video, because actually it redirects the URL. If your URL is direct video URL then only you can get the thumbnail of that video.

您可以使用 http://img.youtube来获取YouTube视频的缩略图. .com/vi/VIDEO_ID/default.jpg ,方法是将VIDEO_ID替换为您自己的视频ID.这是任何YouTube视频的固定链接.

You can get a thumbnail of your YouTube video using http://img.youtube.com/vi/VIDEO_ID/default.jpg by replacing VIDEO_ID with your own video's ID. This is fixed link for any YouTube video.

希望这会有所帮助....:)

Hope this helps.... :)

这篇关于如何在Android列表中获取YouTube视频的视频缩略图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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