2
我想從使用api的youtube得到discriminationptiobn ....但我不知道我在哪裏錯了它沒有得到單個視頻。但如果我嘗試播放列表其做工精細,不帶視頻IDYoutube Api獲取視頻描述與視頻ID
這裏是我的代碼
error_reporting(E_ALL);
$feedURL = 'https://gdata.youtube.com/feeds/api/playlists/'.$id.'?v=2&prettyprint=true';
$sxml = simplexml_load_file($feedURL);
echo $feedURL.'</br>';
foreach ($sxml->entry as $entry)
{
echo $media->group->description;
}
上面的代碼正在與播放列表......但如果我嘗試一個視頻它不工作:
error_reporting(E_ALL);
$feedURL = 'http://gdata.youtube.com/feeds/api/videos/'.$id.'?v=2&alt=json&prettyprint=true';
$sxml = simplexml_load_file($feedURL);
echo $feedURL.'</br>';
foreach ($sxml->entry as $entry)
{
echo $media->group->description;
}
THX Barell ....它幫我解決我的問題....;)...有在網址中出現問題...它應該是'http://gdata.youtube.com/feeds/api/videos/fU-zI53ddGg'.$id',並保持所有相同的工作正常,thx;) – Harinder