Direct Upload Zend PHP: Nasıl videolar yükleniyor ilgili yorumlar devre dışı bırakırım?

0 Cevap php

İşte benim kod bir örnek:

$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();

Bu basitlik için kodu sadece bir örnek olduğunu unutmayınız. Tam kod çok daha karmaşık olduğunu ve çalışmak için test edilmiştir.

Hadi çocuklar, muhtemelen kodu sadece tek bir satır bulunuyor. Bunun üzerine herhangi bir belge bulamadı.

0 Cevap