如何使用 php youtube-api 为视频上传自定义缩略图。
我尝试使用 Zend 框架进行 youtube 直接视频上传,它正在工作,但我找不到任何自定义缩略图上传方法..
我尝试了以下代码
$parms = array('videoId => '' ,mediaUpload => '');
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://www.googleapis.com/upload/youtube/v3/thumbnails/set/');
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $parms);
curl_setopt($ch, CURLOPT_HTTPHEADER, array( "Content-Type: image/jpeg", 'Authorization: Bearer '.$token['access_token']));
$return = json_decode(curl_exec($ch));
error thrown
---------------
{
"error": {
"errors": [
{
"domain": "global",
"reason": "required",
"message": "Required parameter: videoId",
"locationType": "parameter",
"location": "videoId"
}
],
"code": 400,
"message": "Required parameter: videoId"
}
}