Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to show youtube video thumbnails

my site lets users upload the youtube video codes. I am trying to make playlist by showing the thumbnails of the uploaded videos and play the respective video after clicking on specific thumbnail.

i would like to know the method of getting the caption and the thumbnail pictures of those videos which has been uploaded using embed code of youtube?

Edit:

To make question more clear, my users uploads code like one given below:

<object width="640" height="385"><param name="movie" value="http://www.youtube.com/v/-L8DFfSJbqU&hl=en_US&fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/-L8DFfSJbqU&hl=en_US&fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="385"></embed></object>

so from those code how can i find the vedio id first then secondly the thumbnail picture?

like image 838
KoolKabin Avatar asked Aug 04 '10 11:08

KoolKabin


1 Answers

You can try for different types of YouTube videos thumbnails by using these urls -

For the default & normal quality thumbnail:

http://img.youtube.com/vi/<youtube-video-id>/default.jpg

For the high quality (HQ) thumbnail:

http://img.youtube.com/vi/<youtube-video-id>/hqdefault.jpg

There is also a medium quality thumbnail:

http://img.youtube.com/vi/<youtube-video-id>/mqdefault.jpg

For the maximum resolution thumbnail:

http://img.youtube.com/vi/<youtube-video-id>/maxresdefault.jpg

For eg .

YouTube link - http://www.youtube.com/watch?v=4EvNxWhskf8
YouTube video id - 4EvNxWhskf8

So that -

<img src="http://img.youtube.com/vi/4EvNxWhskf8/hqdefault.jpg" title="YouTube Video" alt="YouTube Video" />
like image 173
Rohit Suthar Avatar answered Nov 15 '22 08:11

Rohit Suthar