code.google.com的API爲PHP讓不同的視頻ID的YouTube
我已經使用這個功能:功能printVideoEntry($的VideoEntry),並得到了
Video ID: XXXXXXXXXXXXXXXXXXXXXXXXXX
Watch page: http://www.youtube.com/watch?v=YYYYYYYYYYYYYY&feature=youtube_gdata_player
Flash Player Url: http://www.youtube.com/v/YYYYYYYYYYYYY?version=3&f=playlists&app=youtube_gdata
如果我通過給定的視頻ID它給了我錯誤:
Uncaught exception 'Zend_Gdata_App_HttpException' with message 'Expected response code 200, got 400 Invalid id'
如果我從觀看網頁和Flash播放器網址YYYYYYYYYYYYYYYYY通[兩者都是相同的]我得到它我需要什麼。
幫助非常感謝,提前致謝。
使用此功能爲獲得參賽視頻
function printVideoEntry($videoEntry) {
echo "<div onclick=\"ytvbp.presentVideo('".$videoEntry->getVideoId()."')\" >";
echo 'Video: '.$videoEntry->getVideoTitle() . "<br>";
echo "</div>";
echo 'Video ID: ' . $videoEntry->getVideoId() . "<br>";
echo 'Watch page: ' . $videoEntry->getVideoWatchPageUrl() . "<br>";
echo 'Flash Player Url: ' . $videoEntry->getFlashPlayerUrl() . "<br>";
}
我打電話打印視頻功能從
function getAndPrintPlaylistVideoFeed($playlistListEntry) {
$yt = new Zend_Gdata_YouTube();
$playlistVideoFeed = $yt->getPlaylistVideoFeed($playlistListEntry->getPlaylistVideoFeedUrl());
foreach ($playlistVideoFeed as $playlistVideoEntry) {
$getandprintplaylistvideofeed_array[] = printVideoEntry($playlistVideoEntry);
}
道歉但這是我在stackoverflow上的第一個問題。 – 2012-02-01 14:51:38