我正在尝试通过 API 将新视频上传到 Brightcove,此时我设法仅发布包含视频信息的 json 数据,并且在 Brightcove 中一切都显示正常,但我无法添加将在中上传的视频文件布赖特科夫。我检查了其他答案,但它们对我不起作用,因为它们已经很旧了。感谢帮助!
$access_token = $this->getAccessToken();
$data = array(
'name' => 'test',
'description' => 'test',
'tags' => ['test']
);
$data_string = json_encode($data);
$url = 'https://cms.api.brightcove.com/v1/accounts/1774206337/videos';
$ch = curl_init();
curl_setopt_array($ch, array(
CURLOPT_URL => $url,
CURLOPT_POSTFIELDS => $data_string,
CURLOPT_HTTPHEADER => array(
'Content-type: application/json',
"Authorization: Bearer {$access_token}",
)
));
$result = curl_exec($ch);
dd($result);