Via URL
YouTube has a specific URL for collecting the thumbnails of videos:
http://img.youtube.com/vi/VIDEO_ID/#.jpg
The #
can be 0, 1, 2, or 3 that match the thumbnails that YouTube generates for the video:
Via number:
0 = 480×360 pixeis (Tamanho normal)
1 = 120×90 pixeis (captura 01)
2 = 120×90 pixeis (captura 02)
3 = 120×90 pixeis (captura 03)
Via Quality:
default = 120x90 pixeis (normal)
mqdefault = 320x180 pixels (qualidade média)
hqdefault = 480x360 pixels (qualidade elevada)
For HD videos we also have:
sddefault = 640x480 pixels (normal)
maxresdefault = 1920x1080 pixels (máxima resolução)
The usage is simple:
http://img.youtube.com/vi/wDP2Q11Dc5k/1.jpg
or
http://img.youtube.com/vi/wDP2Q11Dc5k/default.jpg
ThroughtheAPIv2.0
UsingtheAPIishighlyrecommendedasthumbnailsfromtheURLarenotdocumentedmakingitimpractical.
ExampletousetheAPItocollectthesamethumbnailshownabove:
jQueryand YouTube API 2.0
$.getJSON("http://gdata.youtube.com/feeds/api/videos/wDP2Q11Dc5k?v=2&alt=jsonc", function(json){
$("<img/>").attr("src", json.data.thumbnail.sqDefault).appendTo("body");
});
Many other information comes with using the API: