php - 直接上载Zend PHP:如何禁用对正在上载的视频的评论?

标签 php api zend-framework video youtube

这是我的代码示例:

$httpClient = Zend_Gdata_ClientLogin::getHttpClient( $username, $password, $service, $client, $source, $loginToken, $loginCaptcha, $authenticationURL);
$httpClient->setHeaders('X-GData-Key', "key=${myDeveloperKey}");

$yt = new Zend_Gdata_YouTube($httpClient);

$myVideoEntry = new Zend_Gdata_YouTube_VideoEntry();

$filesource = $yt->newMediaFileSource($filename);
$filesource->setContentType('video/quicktime');
$filesource->setSlug($filename);

$myVideoEntry->setMediaSource($filesource);

$mediaGroup = $yt->newMediaGroup();
$mediaGroup->title = $yt->newMediaTitle()->setText(POST("title"));
$mediaGroup->description = $yt->newMediaDescription()->setText(POST("description"));
$mediaGroup->category = array(
    $yt->newMediaCategory()->setText(POST("category"))->setScheme('http://gdata.youtube.com/schemas/2007/categories.cat'),
    $yt->newMediaCategory()->setText('mydevelopertag')->setScheme('http://gdata.youtube.com/schemas/2007/developertags.cat')
);
$mediaGroup->keywords = $yt->newMediaKeywords()->setText(POST("tags"));

$myVideoEntry->mediaGroup = $mediaGroup;
$uploadUrl = 'http://uploads.gdata.youtube.com/feeds/users/default/uploads';
$newEntry = $yt->insertEntry($myVideoEntry, $uploadUrl, 'Zend_Gdata_YouTube_VideoEntry');

$youtube_id = $newEntry->getVideoID();

请注意,为简单起见,这只是代码示例。完整的代码要复杂得多,并且经过测试可以正常工作。

伙计们,这可能只是一行代码。我找不到任何文档。

最佳答案

搜寻Zend_Gdata_YouTube_VideoEntry disable comments会出现this:

I'm not sure that the latest Zend client library release has added native support for the yt:accessControl setting yet. You should be able to manually construct the relevant Atom XML element based on the language-neutral documentation: ....



看来您必须更改要发送的原始数据。我不知道那有多困难。也许无论如何都会有帮助。

关于php - 直接上载Zend PHP:如何禁用对正在上载的视频的评论?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4058419/

相关文章:

php - 从 Woocommerce 3 中的隐藏输入字段自定义价格设置购物车项目价格

php - 这个准备好的语句可以防止 SQL 注入(inject)吗?

javascript - 错误 : SyntaxError: Unexpected end of JSON input at fetch. then.response

api - 时间范围的 Twitter API 推文

php - zend 使用 Decoration 在文本框旁边移动服务器端验证消息

javascript - 如何将 View 内的javascript变量传递给php中的 Controller

javascript - 使用 ajax、php 加载更多帖子

zend-framework - 主键列(id)不是该表()中的列

javascript - Trello token 安全问题?

MySQL注入(inject)出错