2013-03-21 35 views
0

当我在视频条目上使用getEditLink()时,即使连接的用户是视频作者,也始终为空。Zend的Gdata/Youtube API库的getEditLink()始终为空

// $this->yt_user is the Zend_Gdata_YouTube object that is connected 
// to the API using the user's session token. This same object was 
// used to upload the video to the user's account. 
// $input['get'] is sanitized $_GET. The id value is the video's ID 
// sent by Youtube after a video upload from the browser. 

$videoEntry = $this->yt_user->getVideoEntry($input['get']['id']); 

var_export($videoEntry->getEditLink()); 

我可以通过调用var_export($ videoEntry)来验证$ videoEntry是一个有效的视频。我需要能够在上传后编辑视频,但由于getEditLink()总是空,我不能调用$ videoEntry-> getEditLink() - > getHref();

+0

你可以看看这个主题 - 它看起来很相关:https://groups.google.com/forum/?fromgroups=#!topic/youtube-api-gdata/fMPw0fPXOaQ – 2013-03-21 19:35:57

+1

另外:http:// my- sliit.blogspot.com/2010/08/how-to-get-editable-video-entry-youtube.html – 2013-03-21 19:57:38

+0

啊。我读过的例子从来没有显示视频ID以外的方法的任何参数。多谢你们。 – Samutz 2013-03-21 20:28:27

回答

0

由于对问题的评论,找到了答案。

getVideoEntry()要求第三个参数为true以返回可编辑的视频条目。

$videoEntry = $this->yt_user->getVideoEntry($input['get']['id'], null, true); 

我读过的所有例子都显示了这一点(主要来自Google的文档或Zend的文档)。他们只显示第一个参数。