Did you know that YouTube automatically generates thumbnail images for all videos? Each video gets the following four thumbnail images automatically generated:

  • http://img.youtube.com/vi/{VIDEO_CODE}/default.jpg
  • http://img.youtube.com/vi/{VIDEO_CODE}/1.jpg
  • http://img.youtube.com/vi/{VIDEO_CODE}/2.jpg
  • http://img.youtube.com/vi/{VIDEO_CODE}/3.jpg

In addition to these thumbnail images, a larger still of the video is generated and stored in http://img.youtube.com/vi/{VIDEO_CODE}/0.jpg.

Try Me!

I wrote the following JSBin example to display the thumbnails for the specified YouTube video URL:
JS Bin on jsbin.com

If you worked at Monetate in the year 2012 I am sure you recognized the Harlem Shake video :-D. Anyway, you can find a lot more information in the YouTube Data API. This post is just a quick example showing how easy it is to get the thumbnail images for a specific video. Have fun! šŸ˜Ž

Categories: BlogJavaScript

Leave a Reply

Your email address will not be published. Required fields are marked *