2013-03-21 74 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的文檔)。他們只顯示第一個參數。