views:

49

answers:

1

I have an application in which I have manually uploaded videos using Youtube Data API.

It is working fine.

But now I want to display thumbnails of video uploaded by my users in my application.

I have tried a lot for this with getVideoThumbnails(), but I can not get videoEntry object of recently uploaded video.

This is my code :

$yt = new Zend_Gdata_YouTube($httpClient,$applicationkey,null,$developerkey);

$videoEntry = $yt->getVideoEntry('the0KZLEacs');

$videoThumbnails = $videoEntry->getVideoThumbnails();

  foreach($videoThumbnails as $videoThumbnail) {

    echo $videoThumbnail['time'] . ' - ' . $videoThumbnail['url'];
    echo ' height=' . $videoThumbnail['height'];
    echo ' width=' . $videoThumbnail['width'] . "\n";
  }

Here, the0KZLEacs is a id of uploaded video.

Have any idea?

Thanks in advance...

+1  A: 

Try:

http://i3.ytimg.com/vi/<?php echo $video_id; ?>/default.jpg

Where $video_id is the ID of your YouTube video.

Martin Bean
Thanks man I think it will work for me.But will it work also for recently uploaded video ?Thanks again..
Kapil
If anyone else have a different solution, then please give your solution...
Kapil