Uploading a video to YouTube using an older version of the Zend Framework, prior to 1.5.3


We have recently added convenience methods that make uploading video entries to the YouTube API much easier than before. For those that are still using older versions of the PHP Client Library, prior to 1.5.3 of the Zend Framework, the snippet below explains how to upload a video entry. Note that this still works in version 1.5.3 and will continue to work in future revisions:
// assuming that $yt is a fully authenticated YouTube service object

// create a new Zend_Gdata_YouTube_VideoEntry object
$myVideoEntry = new Zend_Gdata_YouTube_VideoEntry();

// create a new Zend_Gdata_App_MediaFileSource object for your video file (if using direct upload)
$filesource = $yt->newMediaFileSource('/path/to/mytestmovie.mov');
$filesource->setContentType('video/quicktime');

// set slug header
$filesource->setSlug('mytestmovie.mov');

// add the filesource to the video entry
$myVideoEntry->setMediaSource($filesource);

// create a new Zend_Gdata_YouTube_Extension_MediaGroup object
$mediaGroup = $yt->newMediaGroup();
$mediaGroup->title = $yt->newMediaTitle()->setText('My Test Movie');
$mediaGroup->description = $yt->newMediaDescription()->setText('My description');

// the category must be a valid YouTube category
// optionally set some developer tags*
$mediaGroup->category = array(
$yt->newMediaCategory()->setText('Autos')->setScheme('http://gdata.youtube.com/schemas/2007/categories.cat'),
$yt->newMediaCategory()->setText('mydevelopertag')->setScheme('http://gdata.youtube.com/schemas/2007/developertags.cat'),
$yt->newMediaCategory()->setText('anotherdevelopertag')->setScheme('http://gdata.youtube.com/schemas/2007/developertags.cat')
);

// set keywords, please note that they cannot contain white-space
$mediaGroup->keywords = $yt->newMediaKeywords()->setText('cars, funny');
$myVideoEntry->mediaGroup = $mediaGroup;

// optionally set video location
$yt->registerPackage('Zend_Gdata_Geo');
$yt->registerPackage('Zend_Gdata_Geo_Extension');
$where = $yt->newGeoRssWhere();
$position = $yt->newGmlPos('37.0 -122.0');
$where->point = $yt->newGmlPoint($position);
$myVideoEntry->setWhere($where);


// upload URL for the currently authenticated user
$uploadUrl = 'http://uploads.gdata.youtube.com/feeds/users/default/uploads';

try {
$newEntry = $yt->insertEntry($myVideoEntry, $uploadUrl, 'Zend_Gdata_YouTube_VideoEntry');
} catch (Zend_Gdata_App_HttpException $httpException) {
echo $httpException->getRawResponseBody();
} catch (Zend_Gdata_App_Exception $e) {
echo $e->getMessage();
}
* Find out more about developer tags

32 comments:

obama said...

I give good love
I’ll buy your clothes
I’ll cook your dinner too
Soon as I get home from work
perth strippersfree porn

Just A Spammer said...
This comment has been removed by the author.
Just A Spammer said...

Close your eyes, give me your hand, darlingDo you feel my heart beating
Do you understand
Do you feel the sameEscorts SydneyEscort Accompagnatrici

Just A Spammer said...

Do you understand
Do you feel the same
Am I only dreaming
Is this burning an eternal flameescorts sydneyshop sex

Just A Spammer said...

I believe it's meant to be, darling
I watch you when you are sleeping
You belong with me
Do you feel the samelive sexfree porn

Just A Spammer said...

Do you understand
Do you feel the same
Am I only dreaming
Is this burning an eternal flamelivesexSydney Escorts

Just A Spammer said...

Say my name sun shines through the rain
A whole life so lonely
And then you come and ease the pain
I don't want to lose this feelingUK Escortfree porn

Just A Spammer said...

Close your eyes, give me your hand, dfree pornsydney escort

Just A Spammer said...

Do you understand
Do you feel the same
Am I only dreaming
Is this burning an eternal flameMelbourne EscortsEscort

Just A Spammer said...

Do you understand
Do you feel the same
Am I only dreaming
Is this burning an eternal flamesex videoLondon Escorts

Just A Spammer said...

I believe it's meant to be, darling
I watch you when you are sleeping
You belong with me
Do you feel the sameEscortweb cam chat

Just A Spammer said...

You belong with me
Do you feel the same
Am I only dreaming
Or is this burning an eternal flameproduto eroticoEscort Sydney

Just A Spammer said...

Close your eyes, give me your hand, darling
Do you feel my heart beating
Do you understand
Do you feel the sameLas Vegas Escortfree porn

Just A Spammer said...

Do you understand
Do you feel the same
Am I only dreaming
Is this burning an eternal flameLas Vegas Escortfree porn

Just A Spammer said...

You belong with me
Do you feel the same
Am I only dreaming
Or is this burning an eternal flamefree webcamsVegas Escort

Just A Spammer said...

Close your eyes, give me your hand, darling
Do you feel my heart beating
Do you understand
Do you feel the samecam chatVegas Escorts

Just A Spammer said...

You belong with me
Do you feel the same
Am I only dreaming
Or is this burning an eternal flameweb cam to camsydney escorts

Just A Spammer said...

Say my name sun shines through the rain
A whole life so lonely
And then you come and ease the pain
I don't want to lose this feelingfree webcamsVegas Escorts

Just A Spammer said...

Ooh, if there's one thing I hang onto
That gets me through the night
I ain't gonna do what I don't want to
I'm gonna live my lifechat sexfree porn

Just A Spammer said...

Shining like a diamond, rolling with the dice
Standing on the ledge, show the wind how to fly
When the world gets in my face
I say, have a nice day
Have a nice dayfree webcamsprodutos eroticos

Just A Spammer said...

Ooh, if there's one thing I hang onto
That gets me through the night
I ain't gonna do what I don't want to
I'm gonna live my lifeLas Vegas Escortfree webcams

Just A Spammer said...

Ooh, if there's one thing I hang onto
That gets me through the night
I ain't gonna do what I don't want to
I'm gonna live my lifefree pornfree webcams

Just A Spammer said...

Shining like a diamond, rolling with the dice
Standing on the ledge, show the wind how to fly
When the world gets in my face
I say, have a nice day
Have a nice daysex videosfree porn

Just A Spammer said...

Ooh, if there's one thing I hang onto
That gets me through the night
I ain't gonna do what I don't want to
I'm gonna live my lifefree pornvibrador

Just A Spammer said...

Close your eyes, give me your hand, darling
Do you feel my heart beating
Do you understand
Do you feel the sameLondon Escortcam sex

Just A Spammer said...

Say my name sun shines through the rain
A whole life so lonely
And then you come and ease the pain
I don't want to lose this feelingUK Escortcam live

Just A Spammer said...

Close your eyes, give me your hand, darling
Do you feel my heart beating
Do you understand
Do you feel the sameLas Vegas Escortcam to cam

kosovohp said...

socks5 | socks proxy | proxy free | proxy
socks proxy | socks5 | proxy | proxy free

Hiphop4Cash said...

hello, this post is amazing, i would like to read more about it, because think that this information is very interesting.
Elektriske dildoerGold Coast Escorts

Le Duc Tho said...

free ebook download
free download wallpaper
free magazine download
computer wallpaper

thanh tung said...

healthtips
healthtips
healthtips
healthtips
healthtips




socks proxy
socks proxy
socks proxy
socks proxy
socks proxy
socks proxy
socks proxy
socks proxy
socks proxy
socks proxy
check socks proxy
socks proxy
socks proxy






funnystory
funnystory
funnystory
funnystory
funnystory




funny pictures
funny pictures
funny pictures
funny pictures
funny pictures
funny pictures






Girl Xinh
Girl Xinh
Girl Xinh
Girl Xinh
Girl Xinh
Girl Xinh
Girl Xinh





cute animal
food news
internet
football news
bank news
marketing
science news
travel vietnamt
real estate vietnam
business news
music news
health news
software
seo news

thanh tung said...

Girl Xinh | Hot Girl | Cute Girl | Sexy Girl |Hot Girl Asian | Hot Girl Xinh
Funny Story | Funny Stories | Funny | lol
Funny Pictures | funny | lol
Girl Xinh | Hot Girl | Cute GirlSexy Girl |Hot Girl Asian | Hot Girl Xinh | lexi belle | ngoc trinh