开发者

Get response from loading movie to youtube

开发者 https://www.devze.com 2023-04-08 02:03 出处:网络
i am using the ZEND Gdata and youtube api to upload vidoes to youtube http://code.google.com/apis/youtube/2.0/developers_guide_php.html#Direct_Upload

i am using the ZEND Gdata and youtube api to upload vidoes to youtube http://code.google.com/apis/youtube/2.0/developers_guide_php.html#Direct_Upload

When I upload a Video how do I capture the Video ID that was generated and also the youtube link ?

try 
{
   $newEntry = $yt->insertEntry($myVideoEntry,$uploadUrl,'Zend_Gdata_YouTube_VideoEntry');
} 
catch (Zend_Gdata_App_HttpException $httpExce开发者_C百科ption) 
{
   echo $httpException->getRawResponseBody();
} 
catch (Zend_Gdata_App_Exception $e) 
{
   echo $e->getMessage();
}

thank you very much


This line:

$newEntry = $yt->insertEntry($myVideoEntry,$uploadUrl,'Zend_Gdata_YouTube_VideoEntry');

returns a Zend_Gdata_YouTube_VideoEntry object.

The Zend Framework API docs for Zend_Gdata_YouTube_VideoEntry lists all the methods and properties that class makes available. There is similar documentation for all Zend Framework classes, and it's automatically generated, so it's often a good place to go if the manual doesn't answer a question.

From looking there, I'd say that you'd call:

  • $newEntry->getVideoId() to get the video ID
  • $newEntry->getVideoWatchPageUrl() to get the video URL
0

精彩评论

暂无评论...
验证码 换一张
取 消