如何在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.... :)