0
我想使用GData將視頻添加到播放列表。所以我在創建播放列表時沒有任何問題,但我無法爲其添加視頻。 這是我做的:YouTube API getPlaylistVideoFeedUrl問題
$playlist = $yt->newPlaylistListEntry();
$playlist->summary = $yt->newDescription()->setText("test");
$playlist->title = $yt->newTitle()->setText("test2");
$postLocation = 'http://gdata.youtube.com/feeds/api/users/default/playlists';
$yt->insertEntry($playlist, $postLocation);
$feedUrl = $playlist->getPlaylistVideoFeedUrl();
$videoEntryToAdd = $yt->getVideoEntry(..given id here..);
$newPlaylistListEntry = $yt->newPlaylistListEntry($videoEntryToAdd->getDOM());
$yt->insertEntry($newPlaylistListEntry, $feedUrl);
而且我得到以下錯誤:
Notice: Trying to get property of non-object in C:...\library\Zend\Gdata\YouTube\PlaylistListEntry.php on line 296
它是此代碼導致的:
$feedUrl = $playlist->getPlaylistVideoFeedUrl();
var_dump
表明$feed_url
是NULL 。它顯示$playlist
是一個對象Zend_Gdata_YouTube_PlaylistListEntry
,所以我不明白爲什麼它寫道「非對象的屬性」。