YouTube API PHP V3:上传与RecordingDetails(谷歌API客户端V2)



每次Youtube上传呼叫都失败,只要包含"RecordingDetails"。

下面简单的Call (Extract):

$rc=new Google_Service_YouTube_VideoRecordingDetails();
$rc->setRecordingDate('2016-08-02T21:17:00.000Z');
$video->setRecordingDetails($rc);

失败。我还尝试了一个Location:

$rc=new Google_Service_YouTube_VideoRecordingDetails();
$ld=new Google_Service_YouTube_GeoPoint();
$ld->setLatitude(36.527294814546);
$ld->setLongitude(128.5400390625);
$rc->setLocation($ld);
$video->setRecordingDetails($rc);

出现相同的错误。另外,错误信息并没有真正的帮助:)

"error": {
  "errors": [
   {
    "domain": "youtube.part",
    "reason": "unexpectedPart",
    "message": "{0}",
    "locationType": "parameter",
    "location": "part"
   }
  ],
  "code": 400,
  "message": "{0}"
 }
}

有没有人已经提到上载一个视频与Api V3和谷歌客户端V2和RecordingDetail?

如果有人感兴趣,下面是RecordingDetails对象的样子:

Google_Service_YouTube_VideoRecordingDetails Object
(
    [locationType:protected] => Google_Service_YouTube_GeoPoint
    [locationDataType:protected] => 
    [locationDescription] => 
    [recordingDate] => 2016-08-02T21:17:00.000Z
    [internal_gapi_mappings:protected] => Array
        (
        )
    [modelData:protected] => Array
        (
        )
    [processed:protected] => Array
        (
        )
    [location] => Google_Service_YouTube_GeoPoint Object
        (
            [altitude] => 
            [latitude] => 36.527294814546
            [longitude] => 128.5400390625
            [internal_gapi_mappings:protected] => Array
                (
                )
            [modelData:protected] => Array
                (
                )
            [processed:protected] => Array
                (
                )
        )
)

谢谢,Christoph

修改

$youtube->videos->insert('status,snippet', $video);

$youtube->videos->insert('status,snippet,recordingDetails', $video);

最新更新