I upload some video using Browser-based upload method. The video is uploaded fine, however I can't manage to fetch this recently uploaded video's id. Here's what I did:
$vidEntry = new Zend_Gdata_YouTube_VideoEntry();
...
...
$tokenHandlerUrl = 'http://gdata.youtube.com/action/GetUploadToken';
$tokenArray = $yt->getFormUploadToken($vidEntry, $tokenHandlerUrl);
$tokenValue = $tokenArray['token'];
$postUrl = $tokenArray['url'];
...
...
posting using cURL...
And the problematic code:
$state = $vidEntry->getVideoState();
if($state) {
$video_id = $vidEntry->getVideoId();
} else {
die("Error");
}
And the $state here is NULL. What's the problem?
BTW according to manual:
After uploading the video file, the user is redirected to the nexturl specified in your form. If the upload was successful, YouTube appends id and status parameters to the URL as shown in the following example:
But I still can't get them (Maybe I'm thinking of the wrong URL?).
Solved. I was just doing a wrong redirect.