当前位置: 首页>>代码示例>>PHP>>正文


PHP Zend_Gdata_YouTube::getFullVideoEntry方法代码示例

本文整理汇总了PHP中Zend_Gdata_YouTube::getFullVideoEntry方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Gdata_YouTube::getFullVideoEntry方法的具体用法?PHP Zend_Gdata_YouTube::getFullVideoEntry怎么用?PHP Zend_Gdata_YouTube::getFullVideoEntry使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Zend_Gdata_YouTube的用法示例。


在下文中一共展示了Zend_Gdata_YouTube::getFullVideoEntry方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: get_element_status

 /**
  *
  * @param Bridge_Element $element
  *
  * @return string
  */
 public function get_element_status(Bridge_Element $element)
 {
     $this->_api->setMajorProtocolVersion(1);
     $state = $this->_api->getFullVideoEntry($element->get_dist_id())->getVideoState();
     if (is_null($state)) {
         $result = Bridge_Element::STATUS_DONE;
     } else {
         $result = $state->getName();
     }
     $this->_api->setMajorProtocolVersion(2);
     return $result;
 }
开发者ID:nlegoff,项目名称:Phraseanet,代码行数:18,代码来源:Youtube.php

示例2: editAction

		function editAction()
		{
			if ($_SESSION['role_id']!=0)
			{
				$this->_redirect($this->view->baseUrl().'/../admin/uploadvideo');
			}
			else 
			{
				$this->view->headTitle('UNC - Admin website');
				$this->view->headLink()->appendStylesheet($this->view->baseUrl().'/application/templates/admin/css/layout.css');
				$this->view->headScript()->appendFile($this->view->baseUrl().'/application/templates/admin/js/jquery-1.7.2.min.js','text/javascript');
				$this->view->headScript()->appendFile($this->view->baseUrl().'/application/templates/admin/js/hideshow.js','text/javascript');
				
				$video_id = $this->_request->getParam('video_id');
				$video_link = $this->mVideo->getVideoLinkById($video_id);
				$this->view->role = $this->role;
				$info = $this->mVideo->getVideoById($video_id);
				$form = $this->formInsert();
				$this->view->listCategoryId = explode(",", $info['category_id']);
				$this->view->listCategory = $this->mVideo->getListVideoCategory();
				
				if($this->role=="0" | ($this->role=="1" & $this->user_login==$info['user_upload']))
				{
					$form->setAction($this->view->baseUrl().'/admin/uploadvideo/edit/video_id/'.$video_id);
					
					$form->getElement('link')->setValue($info['video_full_link']);
					$form->getElement('title')->setValue($info['video_title']);
					$form->getElement('description')->setValue($info['video_description']);
					$form->getElement('is_active')->setValue($info['is_active']);
					
					$this->view->form = $form;
					$this->view->title = 'Sửa thông tin video';		
					
					if($this->_request->isPost())
					{
						$listCategoryId = "";
						foreach($_POST['checkbox'] as $check)
						{
							if($listCategoryId == "")
										$listCategoryId = $check;
							else $listCategoryId = $listCategoryId.','.$check;
						}
						$listCategoryId = str_replace("", "", $listCategoryId);
										
						if($form->isValid($_POST))
						{
							if($video_link != null)
							{
								$input = array(
									'video_link'			=> $video_link,
									'video_title'			=> $form->getValue('title'),
									'video_description'		=> $form->getValue('description'),
									'is_active'				=> $form->getValue('is_active'),
									'category_id'			=> $listCategoryId
								);	
								
								if($this->mVideo->editVideo($input))
								{
									$_SESSION['result']='Cập nhật thành công';
								}
								
								$youtube_id = $this->mVideo->getYouTubeIdByVideoId($video_id);
								$account = $this->mVideo->getAccountByYoutubeId($youtube_id);
								$user = $account['youtube_username'];
								$pass = $account['password'];
								
								try 
								{
									$authenticationURL= 'https://www.google.com/accounts/ClientLogin';
									Zend_Loader::loadClass('Zend_Gdata_ClientLogin');
									$httpClient = Zend_Gdata_ClientLogin::getHttpClient(
													              $username = $user,
													              $password = $pass,
													              $service 	= 'youtube',
													              $client 	= null,
													              $source 	= 'NIWApp', 
													              $loginToken 	= null,
													              $loginCaptcha = null,
													              $authenticationURL
													           );
									Zend_Loader::loadClass('Zend_Gdata_YouTube');
								 	$yt = new Zend_Gdata_YouTube($httpClient, 'NIW-App-1.0', '661085061264.apps.googleusercontent.com', 'AI39si4UPUxw1FE5hqSi0Z-B-5z3PIVovbBWKmqiMI3cXJ7lhvjJcABV-eqimb2EeSiuedWK8N9OGOdB1namX1CqqYki8jEfSQ');
									$video = $yt->getFullVideoEntry($input['video_link']);
					                		$putUrl = $video->getEditLink()->getHref(); 
									$video->setVideoTitle($input['video_title']);
									$video->setVideoDescription($input['video_description']);
					                $yt->updateEntry($video, $putUrl);
							    }
							    catch (Exception $ex) {
							        echo $ex->getMessage();
							        exit;
							    }
								 
								$this->_redirect($this->view->baseUrl().'/../admin/uploadvideo');
							}
							else
							{
								$input = $this->_getInput($form,$listCategoryId);
								if ($this->mVideo->updateVideo($video_id,$input))
								{
//.........这里部分代码省略.........
开发者ID:hungnv0789,项目名称:vhtm,代码行数:101,代码来源:UploadvideoController.php


注:本文中的Zend_Gdata_YouTube::getFullVideoEntry方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。