I am trying to upload a video to youtube using client library v3.
The v3 library is experimental and does not have much documentation (samples provided does not include youtube)
I have properly authenticated user with oauth 2.0. And when I have access token, I am trying with this code.
if ($client->getAccessToken()) {
$snippet = new Google_VideoSnippet();
$snippet -> setTitle = "Demo title";
$snippet -> setDescriptio = "Demo descrition";
$snippet -> setTags = array("tag1","tag2");
$snippet -> setMimeType = 'video/quicktime';
$video = new Google_Video();
$video -> setSnippet($snippet);
// Not sure what to do now....
$_SESSION['access_token'] = $client->getAccessToken();
}
From the docs,
I need to supply a part parameter
The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.
The part names that you can include in the parameter value are snippet, contentDetails, player, statistics, status, and topicDetails. However, not all of those parts contain properties that can be set when setting or updating a video's metadata. For example, the statistics object encapsulates statistics that YouTube calculates for a video and does not contain values that you can set or modify. If the parameter value specifies a part that does not contain mutable values, that part will still be included in the API response.
But it lacks documentation except a python example which I am not able to understand. (the example is at the bottom of the link , I provided)
Please, dont give example/links to zend library, it uses auth-sub which I dont want. I want to use oauth 2.0.