【发布时间】:2011-12-19 16:57:21
【问题描述】:
我想使用 GData 将视频添加到播放列表。所以我创建播放列表没有问题,但我无法向其中添加视频。 这是我的工作:
$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);
我收到以下错误:
注意:试图在 C:...\library\Zend\Gdata\YouTube\PlaylistListEntry.php 第 296 行获取非对象的属性
这是由这段代码引起的:
$feedUrl = $playlist->getPlaylistVideoFeedUrl();
var_dump 表明$feed_url 是NULL。而且它显示$playlist是一个对象Zend_Gdata_YouTube_PlaylistListEntry,所以我不明白为什么它写“非对象的属性”。
【问题讨论】:
标签: php youtube youtube-api gdata