<div class="page-header">
<h1>Videos</h1>
</div>
<?php
 
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
$data = array();
 
$youtube_template = '<object width="680" height="350">
<param name="movie" value="%s"></param>
<embed src="%s"
type="%s" width="680" height="350">
</embed>
</object>';
   
$data = json_decode(file_get_contents('http://gdata.youtube.com/feeds/api/users/inthepinkbigband/uploads/?alt=json'));
 
foreach($data->feed->entry as $video)
{
	$t = '$t';
	$media = 'media$group';
	$thumbnails = 'media$thumbnail';
	
	//print_r($video);
	
	$title = $video->title->$t;
	$content = $video->content->$t;
	$url = $video->$media->{'media$content'}[0]->url . '&color=white';
	echo "<h2>$title</h2>";
	
	//$thumbnails = $video->$media->$thumbnails;
	//print_r($video->$media->$thumbnails);
 
	/*
	  * Thumbnails
	  */
	 
	echo sprintf($youtube_template, $url, $url, $video->$media->{'media$content'}[0]->type);
	 
	foreach($video->$media->$thumbnails as $thumbnail)
	{
		if($thumbnail->height > 300) {}
		//echo '<img src="' . $thumbnail->url . '" alt="' . $thumbnail->time .'"/>';
	}
		 
		/*
		  * [url] => http://i.ytimg.com/vi/YLz3Bq9cgj8/0.jpg
		  [height] => 360
		  [width] => 480
		  [time] => 00:01:44
		  */
}

 
?>