amigo mira el codigo q uso
Código PHP:
Ver original<ul id="grid-content">
<?php
$feedURL = "http://gdata.youtube.com/feeds/api/playlists/5735D8B716DFF2CF?v=2";
// read feed into SimpleXML object
?>
<h1><?php echo $sxml->title; ?></h1>
<?php
// iterate over entries in feed
foreach ($sxml->entry as $entry) :
// get nodes in media: namespace for media information
$media = $entry->children('http://search.yahoo.com/mrss/');
// get video player URL
$attrs = $media->group->player->attributes();
$watch = $attrs['url'];
// get video thumbnail
$attrs = $media->group->thumbnail[0]->attributes();
$thumbnail = $attrs['url'];
// get <yt:duration> node for video length
$yt = $media->children('http://gdata.youtube.com/schemas/2007');
$attrs = $yt->duration->attributes();
$length = $attrs['seconds'];
// get <yt:stats> node for viewer statistics
$yt = $entry->children('http://gdata.youtube.com/schemas/2007');
$attrs = $yt->statistics->attributes();
$viewCount = $attrs['viewCount'];
// get <gd:rating> node for video ratings
$gd = $entry->children('http://schemas.google.com/g/2005');
if ($gd->rating) {
$attrs = $gd->rating->attributes();
$rating = $attrs['average'];
} else {
$rating = 0;
}
?>
<li>
<div class="view view-first">
<a href="<?php echo $watch; ?>"><img src="<?php echo $thumbnail;?>" /></a>
<div class="mask">
<h2 style="padding: 5px;">
<?php echo Html
::link("video/{$item->id}", substr($media->group->title,0,20)) ?></h2>
<?php echo Html
::link("video/{$item->id}","Play","class='button .btn-danger'"); ?> </div>
</div>
</li>
<?php endforeach; ?>
</ul>