Displaying Youtube Videos (Help)

Shadee

New Member
I'll try to make this short. What I would like to do, is have a "videos" page on my website. On this page, I'd like to have a list of video thumbnails, running left to right, that are my most recently uploaded videos on youtube. If you have used youtube, I basically want it to look exactly like the "subscriptions" tab on the main page when you're signed in.

I've had a look at the youtube api.. and it greatly confuses me. They generate a ton of code, and some of it looks like what I need, but they don't explain how to display it, or modify it really. I'm not sure if I'm just supposed to be copying and pasting their code directly onto the page? They say it's using php, java, python, etc. so I'm not sure if I have to code how the information is displayed after the api retrieves it in those languages..

Any help is appreciated! This is the last page I need to complete on my website, and it would be a huge relief to have it done.

Also, a link to the site currently - http://www.shadeegaming.com
 
Last edited:

benjamin.morgan

New Member
Use simplexml_load_file () with the you tube file get the api link inside the parentheses and do a foreach loop to get each video and echo the video. link
$xml = simplexml_load_file("http://gdata.youtube.com/feeds/base/users/toshibaUS/uploads?alt=rss&v=2&orderby=published& client=ytapi-youtube-profile");
foreach ($xml->link as $video)
{
echo "<iframe class='youtube-player' type='text/html' width='640' height='385' src='". $video ."' frameborder='0'>
</iframe>";
}


Play with it.
 
Last edited:

Shadee

New Member
As much as I would like the page to have a video player, what I need is an actual list of the last 4-5 uploads, with thumbnail images, title, and views, almost exactly like youtube has on the subscriptions page. Only displaying one video on the page doesn't help much.
 

Janja

New Member
To have the video's in one row, make a container to hold the videos. Use the iframe code from youtube and wrap div tags around them and float them to the left. Use a size that is small enough for that. The iframe has a thumbnail already in it.
That would be the basic option without scroll for more videos.
For the scrolling, you might want to check into a javascript based gallery. Otherwise try Activeden.com for a flash gallery that lets you insert your video code.
I know, it's not automated but it's also not that complicated that way...
 
Top