Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to get video thumbnail of youtube video in android list in android [duplicate]

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

like image 378
Sandip Jadhav Avatar asked Dec 28 '11 11:12

Sandip Jadhav


People also ask

Can we copy thumbnail from YouTube?

To get the thumbnail, open the video and copy the URL from the browser address bar. If you're using the YouTube mobile app, locate the Share button and copy the URL to your clipboard.

How do you copy a thumbnail?

Just hover your mouse over the input or output cell, then slide the mouse pointer over the thumbnail. Right-click and select Copy.

How do I get the thumbnail from a video?

Making a video thumbnail is relatively straightforward. You can take a screenshot from your video that best explains its contents, or you can use a tool like Photoshop or Canva to overlay text or icons on the image. To make a screen capture on a PC, use the Windows Snipping Tool.


2 Answers

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'/]

like image 29
peasea Avatar answered Oct 11 '22 19:10

peasea


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.... :)

like image 167
Hiren Dabhi Avatar answered Oct 11 '22 20:10

Hiren Dabhi