本文整理汇总了PHP中Zend_Gdata_YouTube_VideoEntry::SetVideoDeveloperTags方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Gdata_YouTube_VideoEntry::SetVideoDeveloperTags方法的具体用法?PHP Zend_Gdata_YouTube_VideoEntry::SetVideoDeveloperTags怎么用?PHP Zend_Gdata_YouTube_VideoEntry::SetVideoDeveloperTags使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Gdata_YouTube_VideoEntry
的用法示例。
在下文中一共展示了Zend_Gdata_YouTube_VideoEntry::SetVideoDeveloperTags方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: substr
$vidName = $dom->getElementById("source_video")->getAttribute('value');
$lectureTitle = $dom->getElementById("title")->getAttribute('value');
if ($lectureTitle == "CKY Example (21:52)" || $lectureTitle == "CKY Parsing (23:25)" || $lectureTitle == "Charniak's Model (18:23)" || $lectureTitle == "Discriminative Model Features") {
echo $lectureTitle . ": " . $vidName . "\n";
$filesource = $yt->newMediaFileSource('../source_videos/' . $vidName);
$filesource->setContentType('video/mp4');
$filesource->setSlug($vidName);
$myVideoEntry->setMediaSource($filesource);
$myVideoEntry->setVideoTitle($lectureTitle);
$myVideoEntry->setVideoDescription($lectureTitle);
// Note that category must be a valid YouTube category !
$myVideoEntry->setVideoCategory('Education');
// Set keywords, note that this must be a comma separated string
// and that each keyword cannot contain whitespace
$myVideoEntry->SetVideoTags('natural language processing');
$myVideoEntry->SetVideoDeveloperTags(array('NLPClass', substr($lectureTitle, 0, 16)));
//Turn off ratings, comments, videoResponses and make video unlisted
$listElement = new Zend_Gdata_App_Extension_Element('yt:accessControl', 'yt', 'http://gdata.youtube.com/schemas/2007', '');
$listElement->extensionAttributes = array(array('namespaceUri' => '', 'name' => 'action', 'value' => 'list'), array('namespaceUri' => '', 'name' => 'permission', 'value' => 'denied'));
$commentElement = new Zend_Gdata_App_Extension_Element('yt:accessControl', 'yt', 'http://gdata.youtube.com/schemas/2007', '');
$commentElement->extensionAttributes = array(array('namespaceUri' => '', 'name' => 'action', 'value' => 'comment'), array('namespaceUri' => '', 'name' => 'permission', 'value' => 'denied'));
$videoRespondElement = new Zend_Gdata_App_Extension_Element('yt:accessControl', 'yt', 'http://gdata.youtube.com/schemas/2007', '');
$videoRespondElement->extensionAttributes = array(array('namespaceUri' => '', 'name' => 'action', 'value' => 'videoRespond'), array('namespaceUri' => '', 'name' => 'permission', 'value' => 'denied'));
$rateElement = new Zend_Gdata_App_Extension_Element('yt:accessControl', 'yt', 'http://gdata.youtube.com/schemas/2007', '');
$rateElement->extensionAttributes = array(array('namespaceUri' => '', 'name' => 'action', 'value' => 'rate'), array('namespaceUri' => '', 'name' => 'permission', 'value' => 'denied'));
$myVideoEntry->extensionElements = array($listElement, $commentElement, $videoRespondElement, $rateElement);
// Upload URI for the currently authenticated user
$uploadUrl = 'http://uploads.gdata.youtube.com/feeds/users/default/uploads';
// Try to upload the video, catching a Zend_Gdata_App_HttpException
// if availableor just a regular Zend_Gdata_App_Exception
try {