YouTube Image Thumbnails (Arthemia Related)

5. November 2009

While extending the Arthemia theme for a client (Community Hospital EMR, part of the EHR Group, Inc.) we ran into an issue around providing an appropriate abstract for posts which were really only a couple of lines of introduction and a YouTube link. Of course adding a video-thumbnail instantly gives the Featured abstract the instant context of being a video. However, we didn’t want to over-engineer the theme with logic to detect the presence of a YouTube object.

Our friend Google turned up a post by Bernie Zimmermann detailing how to extract a Dynamic YouTube Image Thumbnail.

We can amend the standard YouTube URL format, to deliver one of three image-thumbnails available for any YouTube video. When a video is uploaded to YouTube, three image thumbnails are automatically created, and the video author can elect one as they preferred thumbnail.

This top URL is the actual YouTube video

VIDEO URL is http://www.youtube.com/watch?v=bNF_P281Uu4

IMAGE URL is http://img.youtube.com/vi/bNF_P281Uu4/2.jpg

This bottom URL is the thumbnail #2 for this video. Therefore we can play with the image URL to get the best image to place as a thumbnail for our article. These are images 1.jpg, 2.jpg (the best and most iconic for the video) and 3.jpg.

  

A little bit of additional digging reveals the default image used by the YouTube video window. This is image 0.jpg.

BlogEngine.NET, Featured ,