views:

19

answers:

1

Here's a sample of my code:

$httpClient = Zend_Gdata_ClientLogin::getHttpClient( $username, $password, $service, $client, $source, $loginToken, $loginCaptcha, $authenticationURL);
$httpClient->setHeaders('X-GData-Key', "key=${myDeveloperKey}");

$yt = new Zend_Gdata_YouTube($httpClient);

$myVideoEntry = new Zend_Gdata_YouTube_VideoEntry();

$filesource = $yt->newMediaFileSource($filename);
$filesource->setContentType('video/quicktime');
$filesource->setSlug($filename);

$myVideoEntry->setMediaSource($filesource);

$mediaGroup = $yt->newMediaGroup();
$mediaGroup->title = $yt->newMediaTitle()->setText(POST("title"));
$mediaGroup->description = $yt->newMediaDescription()->setText(POST("description"));
$mediaGroup->category = array(
    $yt->newMediaCategory()->setText(POST("category"))->setScheme('http://gdata.youtube.com/schemas/2007/categories.cat'),
    $yt->newMediaCategory()->setText('mydevelopertag')->setScheme('http://gdata.youtube.com/schemas/2007/developertags.cat')
);
$mediaGroup->keywords = $yt->newMediaKeywords()->setText(POST("tags"));

$myVideoEntry->mediaGroup = $mediaGroup;
$uploadUrl = 'http://uploads.gdata.youtube.com/feeds/users/default/uploads';
$newEntry = $yt->insertEntry($myVideoEntry, $uploadUrl, 'Zend_Gdata_YouTube_VideoEntry');

$youtube_id = $newEntry->getVideoID();

Please note that this is just a sample of the code for simplicity. The full code is much more complex and is tested to work.

C'mon guys, it's probably just a single line of code. I couldn't find any documentation on it.

+1  A: 

Googling for Zend_Gdata_YouTube_VideoEntry disable comments turns up this:

I'm not sure that the latest Zend client library release has added native support for the yt:accessControl setting yet. You should be able to manually construct the relevant Atom XML element based on the language-neutral documentation: ....

it looks like you'd have to change the raw data being sent. I don't know how difficult that is. Maybe it helps anyway.

Pekka
Thanks for the pointer!
gAMBOOKa