【问题标题】:Zend's Gdata/Youtube API Library's getEditLink() always nullZend 的 Gdata/Youtube API 库的 getEditLink() 始终为空
【发布时间】:2013-03-21 16:17:05
【问题描述】:

当我对视频条目使用 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()总是为null,所以不能调用$videoEntry->getEditLink()->getHref();

【问题讨论】:

标签: php zend-framework youtube-api


【解决方案1】:

感谢问题的 cmets 找到了答案。

getVideoEntry() 需要第三个参数为真才能返回可编辑的视频条目。

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

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

【讨论】:

    猜你喜欢
    • 2011-06-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-10-01
    • 1970-01-01
    • 2011-11-12
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多