3
YouTube에 업로드하기 위해 google api 예제를 따랐습니다. 그러나 내가 예를 들어 다른 도메인에서 호스팅되는 파일을 업로드 할 경우 :PHP Youtube Data 다른 도메인에서 Api 업로드
이 어떤 도움을 크게YouTube에 업로드하기 위해 google api 예제를 따랐습니다. 그러나 내가 예를 들어 다른 도메인에서 호스팅되는 파일을 업로드 할 경우 :PHP Youtube Data 다른 도메인에서 Api 업로드
이 어떤 도움을 크게젠드 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