Php YOUTUBE API中的insertEntry返回什么?
这就是我们使用YouTube API将视频上传到YouTube的方法 $newEntry=$yt->insertEntry($myVideoEntry,$uploadUrl,'Zend_Gdata_YouTube_VideoEntry') 一旦我们上传,我们如何才能得到我们刚刚上传的视频的唯一代码?? 我的意思是,在url中,Php YOUTUBE API中的insertEntry返回什么?,php,youtube,youtube-api,Php,Youtube,Youtube Api,这就是我们使用YouTube API将视频上传到YouTube的方法 $newEntry=$yt->insertEntry($myVideoEntry,$uploadUrl,'Zend_Gdata_YouTube_VideoEntry') 一旦我们上传,我们如何才能得到我们刚刚上传的视频的唯一代码?? 我的意思是,在url中, “pBI3lc18k8Q”是视频的唯一代码。那么,如何为我们刚刚上传的视频获取此信息???上传后执行以下代码: // Assuming that $videoEntry
“pBI3lc18k8Q”是视频的唯一代码。那么,如何为我们刚刚上传的视频获取此信息???上传后执行以下代码:
// Assuming that $videoEntry is the object that was returned during the upload
$state = $videoEntry->getVideoState();
if ($state) {
echo 'Upload status for video ID ' . $videoEntry->getVideoId() . ' is ' .
$state->getName() . ' - ' . $state->getText() . "\n";
} else {
echo "Not able to retrieve the video status information yet. " .
"Please try again later.\n";
}
您在$newEntry!中获得了您的唯一代码;) 非常好,谢谢,
$newVideoURL=”http://www.youtube.com/watch?v=“$videoEntry->getVideoId()代码>