How to fetch Video Image from youtube

Hi I was desperate to make this work when I finally heard of youtube APIs, through which you can actually get all the information of any video from youtube. I will put the source of phpyoutube if someone needs it.

There are few basic steps to do in your PHP code which are as below:
include(“phpYoutube.php”);

$dev_id     = “XXXXXXXX”;
$account     = “XXXXXXXX”;
$phpYoutube = new phpYoutube($dev_id);
$videos=print_r($phpYoutube->videos_getdetails(“m2fMYM9rJfc”));
$thumbnail_url = $videos['thumbnail_url'];
echo $thumbnail_url;

This is the simplest way to get the image from youtube using API’s
Hope this could help someone.

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.