Reputation: 4649
Hello all In my application, the user will copy and paste the video link of youtube in a text box and once he clicks on the add button I have to display the thumbnail of the video.
How do you render the video thumbnail from the YouTube page?
I am using Jquery and HTML5 at the front end
Upvotes: 3
Views: 1565
Reputation: 11623
It is very easy to get a YouTube thumbnail.
Consider a typical YouTube URL: http://www.youtube.com/watch?v=VIDEOCODE
Extract the VIDEOCODE part, and use one of the following URLs for different flavours:
http://img.youtube.com/vi/VIDEOCODE/0.jpg
http://img.youtube.com/vi/VIDEOCODE/1.jpg
http://img.youtube.com/vi/VIDEOCODE/2.jpg
Upvotes: 2
Reputation: 3795
There is a jQuery plugin for grabbing a YouTube thumbnail from the url you provide.
Take a look at: http://custom-drupal.com/jquery-demo/jyoutube/
http://plugins.jquery.com/project/jyoutube
Upvotes: 1