Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make YouTube video thumbnails in android? [duplicate]

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?

like image 591
Krishna Avatar asked Jan 12 '12 19:01

Krishna


People also ask

Can you use same thumbnails on YouTube?

Thumbnails and other images that violate our Community Guidelines aren't allowed on YouTube. Images include banners, avatars, Community posts, and any other YouTube feature that has images. If you find thumbnails or other images that violate this policy, report them.


1 Answers

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.

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:

  • http://img.youtube.com/vi/GDFUdMvacI0/0.jpg
  • http://img.youtube.com/vi/GDFUdMvacI0/1.jpg
  • http://img.youtube.com/vi/GDFUdMvacI0/2.jpg
  • http://img.youtube.com/vi/GDFUdMvacI0/3.jpg

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.

like image 123
Chad Schultz Avatar answered Sep 30 '22 05:09

Chad Schultz