Hi all, im trying to get SWFUpload to work with the new YouTube API.

I am using the following code to upload a video directly to youtube from SWFUpload:

upload.php


$yt = new Zend_Gdata_YouTube($httpClient);

$upload_name = "Filedata";

$filesource->setContentType('video/mp4');
// set slug header
$filesource->setSlug($upload_name);

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

// create a new Zend_Gdata_YouTube_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 (see Searching by Developer Tags for more details)
$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
$mediaGroup->keywords = $service->newMediaKeywords()->setText('cars, funny');
$myVideoEntry->mediaGroup = $mediaGroup;

// 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);
$entry->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_Exception $e) {
echo $e->getMessage();
}

By setting the $upload_name string to "Filedata" i was hoping that the selected files from SWFUpload would be recognised by the code and send the file but it doesnt seem to upload.

any ideas or has anybody experimented with this before?

Thanks.