Google api php client 谷歌API PHP客户端YouTube“;“可嵌入”;设置不起作用
我于2015年4月7日下载并安装了Google API PHP客户端测试版。我可以使用它将视频上传到YouTube,但在YouTube的视频编辑屏幕中,“允许嵌入”复选框始终处于选中状态,无论我如何尝试通过API进行设置。这就是我所说的复选框: 以下是我上传文件前的代码:Google api php client 谷歌API PHP客户端YouTube“;“可嵌入”;设置不起作用,google-api-php-client,youtube-data-api,Google Api Php Client,Youtube Data Api,我于2015年4月7日下载并安装了Google API PHP客户端测试版。我可以使用它将视频上传到YouTube,但在YouTube的视频编辑屏幕中,“允许嵌入”复选框始终处于选中状态,无论我如何尝试通过API进行设置。这就是我所说的复选框: 以下是我上传文件前的代码: // set up client $client = new Google_Client(); $client->setClientId(...); $client->setClientSecret(...);
// set up client
$client = new Google_Client();
$client->setClientId(...);
$client->setClientSecret(...);
$client->refreshToken(...);
$youtube = new Google_Service_YouTube($client);
// create snippet
$snippet = new Google_Service_YouTube_VideoSnippet();
$snippet->setTitle(...);
$snippet->setDescription(...);
// create status
$status = new Google_Service_YouTube_VideoStatus();
$status->setPrivacyStatus("public");
$status->setEmbeddable(false);
// Create a YouTube video with snippet and status
$video = new Google_Service_YouTube_Video();
$video->setSnippet($snippet);
$video->setStatus($status);
$client->setDefer(true);
$insertRequest = $youtube->videos->insert("status,snippet", $video);
// file chunking and upload here...
Google_Service_YouTube_VideoStatus对象中的privacyStatus选项起作用。如果我将其设置为“private”,视频将作为private上传。因此,问题不在于将状态附加到视频。这只是一个嵌入式选项,似乎不起作用
我这里有三种可能性:
谢谢 客户端库将status.embeddeble传递给API。YouTube v3 API就是罪魁祸首。我终于找到了一张2013年的罚单: