15

I am developing an application where I want to show a list which contains urls of youtube video. I am succeeded in showing list but problem is I am unable to show video thumbnail.

How to create youtube video thumbnail programatically.

Thank You

Edited:-- Hiren Dabhi give solution which I am using now & it solved problem

Thank You

Sandip Jadhav
  • 7,377
  • 8
  • 44
  • 76

2 Answers2

67

It is not possible to get a direct thumbnail of YouTube video, because actually it redirects the URL. If your URL is direct video URL then only you can get the thumbnail of that video.

You can get a thumbnail of your YouTube video using http://img.youtube.com/vi/VIDEO_ID/default.jpg by replacing VIDEO_ID with your own video's ID. This is fixed link for any YouTube video.

Hope this helps.... :)

Pratik Butani
  • 60,504
  • 58
  • 273
  • 437
Hiren Dabhi
  • 3,693
  • 5
  • 37
  • 59
2

How are you getting the list of URLs ?

Read the Google Data API reference : http://code.google.com/apis/youtube/2.0/reference.html#Overview

You can post further queries with the video-id to get the thumbnail image directly which you could display. thumbnail metadata looks like this : [media:thumbnail url='http://img.youtube.com/vi/8aYQ_wjmriQ/2.jpg' height='90' width='120' time='00:01:23' yt:name='default'/]

peasea
  • 346
  • 2
  • 4