Note that there are some explanatory texts on larger screens.

plurals
  1. POZend framework, YouTube API, default title (Browserbased upload)
    primarykey
    data
    text
    <p>I got this code for uploading videos to my youtubeaccount from my website:</p> <pre><code>&lt;?php session_start(); set_time_limit(0); ini_set('memory_limit', '150M'); ini_set('upload_max_filesize', '30M'); ini_set('default_socket_timeout', '6000'); ini_set('max_input_time', '6000'); ini_set('post_max_size', '100M'); ini_set('max_execution_time', '6000'); $clientLibraryPath = 'library'; $oldPath = set_include_path(get_include_path() . PATH_SEPARATOR . $clientLibraryPath); //include Zend Gdata Libs require_once("Zend/Gdata/ClientLogin.php"); require_once("Zend/Gdata/HttpClient.php"); require_once("Zend/Gdata/YouTube.php"); require_once("Zend/Gdata/App/MediaFileSource.php"); require_once("Zend/Gdata/App/HttpException.php"); require_once('Zend/Uri/Http.php'); //yt account info $yt_user = 'xx'; //youtube username or gmail account $yt_pw = 'xx'; //account password $yt_source = 'xx'; //name of application (can be anything) //yt dev key $yt_api_key = 'xx'; //your youtube developer key //login in to YT $authenticationURL= 'https://www.google.com/youtube/accounts/ClientLogin'; $httpClient = Zend_Gdata_ClientLogin::getHttpClient( $username = $yt_user, $password = $yt_pw, $service = 'youtube', $client = null, $source = $yt_source, // a short string identifying your application $loginToken = null, $loginCaptcha = null, $authenticationURL); $yt = new Zend_Gdata_YouTube($httpClient, $yt_source, NULL, $yt_api_key); $myVideoEntry = new Zend_Gdata_YouTube_VideoEntry(); $myVideoEntry-&gt;setVideoTitle('The Movie'); $myVideoEntry-&gt;setVideoDescription('My Test Movie'); $myVideoEntry-&gt;setVideoCategory('Autos'); $myVideoEntry-&gt;SetVideoTags('cars, funny'); $tokenHandlerUrl = 'http://gdata.youtube.com/action/GetUploadToken'; $tokenArray = $yt-&gt;getFormUploadToken($myVideoEntry, $tokenHandlerUrl); $tokenValue = $tokenArray['token']; $postUrl = $tokenArray['url']; // place to redirect user after upload $nextUrl = 'http://sabinequardon.dk'; // build the form $form = '&lt;form id="youtube_upload" action="'. $postUrl .'?nexturl='. $nextUrl . '" method="post" enctype="multipart/form-data" target="uploader"&gt;'. '&lt;input id="title" name="video_title" type="text"/&gt;'. '&lt;input id="file_upload" name="file_upload" type="file"/&gt;'. '&lt;input name="token" type="hidden" value="'. $tokenValue .'"/&gt;'. '&lt;input value="Upload Video File" type="submit" id="submit" /&gt;'. '&lt;/form&gt; '; echo $form; ?&gt; </code></pre> <p>I'm not really good at PHP, and it's the first time I'm trying to use the YouTube API. Been reading everything I could, just didn't seem to help much. I know it's something that I get the metadata first before uploading the video?</p> <p>I need the user to write their own title, so all the video's aren't named the same thing.</p> <p>Is there a way to do this? I've tried looking everywhere, just can't seem to find the right answer. Just annoying if all the videos the users are uploading are called the same.</p> <p>Thank you.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload