Zend_Gdata_YouTube

ユーチューブから動画取得
$yt = new Zend_Gdata_YouTube();
$query = $yt->newVideoQuery();
$query->videoQuery = ‘FC東京 OR fctokyo OR FCTOKYO OR fc東京’;キーワード
$query->startIndex = 0;最初
$query->maxResults = 5;何個
$query->orderBy = ‘rating’;並び(relevance (デフォルト)、publishedviewCount、または rating
$query->setTime(‘this_week’);何時

$videoFeed = $yt->getVideoFeed($query);

foreach ($videoFeed as $videoEntry) {

$videoEntry->getVideoId()
$videoEntry->getVideoTitle()
$videoEntry->getVideoDescription()
$videoEntry->getVideoTags()
$videoEntry->getVideoViewCount()

$videoThumbnails = $videoEntry->getVideoThumbnails();
$videoThumbnails[0][‘url’]
$videoThumbnails[0][‘width’]
$videoThumbnails[0][‘height’]

<object width=”425″ height=”344″>
    <param name=”movie” value=”http://www.youtube.com/v/<?=$this->videoId?>&hl=ja_JP&fs=1&”></param>
    <param name=”allowFullScreen” value=”true”></param>
    <param name=”allowscriptaccess” value=”always”></param>
    <embed src=”http://www.youtube.com/v/<?=$videoEntry->getVideoId()?>&hl=ja_JP&fs=1&” type=”application/x-shockwave-flash” allowscriptaccess=”always” allowfullscreen=”true” width=”425″ height=”344″></embed>
</object>

コメントを残す

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です