2

我必须更新特定频道的多个视频内推广详细信息。我的要求如下:

var requestOptions={
part: 'invideoPromotion',   
onBehalfOfContentOwner: 'contentOwner',         
resource:{          
  id: channelId,

  invideoPromotion: {

    "defaultTiming": {
      "offsetMs": 2000,
      "type": "offsetFromStart"
    },

    "items": [
      {
        "promotedByContentOwner": true,
        "timing":
        {
            "offsetMs":4000,
            "duration" : 5000,
            "type":"offsetFromStart"
        },
        "id":{
            "videoId": videoid1,
            "type": "video"
        }
      },
      {
        "promotedByContentOwner": true,
        "timing":
        {
            "offsetMs":11000,
            "duration" : 5000,
            "type":"offsetFromStart"
        },
        "id":{
            "videoId": videoId2,
            "type": "video"
        }
      }
    ],
    "position": {
      "type": "corner",
      "cornerPosition": "topLeft"
    }
  }
}
};
console.log(requestOptions);
var request = gapi.client.youtube.channels.update(requestOptions);
request.execute(function (response) {});

但是当我尝试执行此操作时,我收到错误

0: {error:{code:500}, id:gapiRpc}
error: {code:500}
code: 500
id: "gapiRpc"

即使我尝试使用 youtube api explorer https://developers.google.com/apis-explorer/#p/youtube/v3/youtube.channels.update执行此操作,我也会收到内部服务器错误。有人可以让我知道我哪里出错了。

4

1 回答 1

0

您不能宣传多个视频。我也尝试了相同的方法,但出现错误“超过了促销项目的数量”。因此,您一次只能宣传一个视频。

于 2016-01-28T14:03:42.810 回答