Krishna Krishna - 4 months ago 26
Android Question

How to make YouTube video thumbnails in android?

In my android Activity I want to play video from YouTube through YouTube application or some other. For that I want to load thumbnails of the video in my activity.

Is this possible? If so, how?

Answer

YouTube puts the thumbnails of the video at a specific predictable URL. It would be a bit of a pain, but I'm sure you could find a way to display the images from the URL, or to download them and then display them.

Here's information on my blog on what those thumbnail URLs are: http://alamoxie.com/blog/web-design/add-youtube-thumbnails/

I'll copy and paste what I wrote in the blog post:

Look at the link for the video–for example, http://www.youtube.com/watch?v=GDFUdMvacI0

Take the video ID… the portion after “v=”, in this case GDFUdMvacI0. If the URL is longer than that, only go until the next ampersand. For example, http://www.youtube.com/watch?v=GDFUdMvacI0&feature=youtu.be is the same, GDFUdMvacI0.

Then just substitute your video ID for the video ID in the following URLs to these thumbnail images:

0.jpg is a full-sized image. The other three are very small (120×90) and are taken automatically by YouTube from three certain points in the video.