2011-03-03 3 views

답변

0

젠드 API

을 감상 할 수있다
$myVideoEntry = new Zend_Gdata_YouTube_VideoEntry(); 

// create a new Zend_Gdata_App_MediaFileSource object 
$filesource = $yt->newMediaFileSource('http://www.myotherdomain.com/.../file.mov'); 
$filesource->setContentType('video/x-flv'); 

// set slug header 
$filesource->setSlug('http://www.myotherdomain.com/.../file.mov'); 

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

아마이 기능을 지원하지 않습니다. 그러나 쓰기 권한이있는 경우 서버에서 파일을 다운로드 한 다음 보낼 수 있습니다.

$curl = curl_init(); 
curl_setopt($curl, CURLOPT_HEADER, 0); 
curl_setopt($curl, CURLOPT_URL, 'http://www.myotherdomain.com/.../file.mov'); 
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); 
$contents = curl_exec($curl); 
curl_close($curl); 

$file = fopen('temp/file.mov', 'w'); // If file is not found, attempts to create it 
fwrite($file, $contents); 
fclose($file); 

// Upload via YouTube