0

当我在视频条目上使用 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();

4

1 回答 1

0

感谢对问题的评论,找到了答案。

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

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

我阅读的所有示例都没有显示这一点(主要来自 Google 的文档或 Zend 的文档)。他们只展示了第一个论点。

于 2013-03-21T20:31:25.463 回答