YouTube API V3使用recordingDetails更新视频

时间:2017-04-25 17:21:45

标签: php youtube-api youtube-data-api

您是否可以在已上传到YouTube的视频中添加或更新recordingDetails

使用以下代码片段,我可以更改标题和说明。我希望能够添加locationDescription,纬度和经度。除非它们在传递时似乎被忽略而没有错误。

$youtube = new Google_Service_YouTube($client);
$listResponse = $youtube->videos->listVideos("snippet,recordingDetails", array('id' => $videoId));
$video = $listResponse[0];
$videoSnippet = $video['snippet'];
$recordingDetails = $video['recordingDetails'];
$videoSnippet['description'] = $videoDesc;
$recordingDetails['locationDescription'] = $address;
$recordingDetails['location']['latitude'] = $latitude;
$recordingDetails['location']['longitude'] = $longitude;
$updateResponse = $youtube->videos->update("snippet,recordingDetails", $video);

添加新视频时,我可以选择添加这些值,以后不再添加。

0 个答案:

没有答案