YouTube LiveBroadcast移除绑定流并将lifeCycleStatus从“就绪”转换为“直播”或“已创建”

时间:2018-03-12 14:38:21

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

我在尝试将YouTube LiveBroadcast从ready转换为live时遇到问题。 liveBroadcast看起来像这样

  {
   "kind": "youtube#liveBroadcast",
   "id": "VALID_ID",
   "snippet": {
    "publishedAt": "2018-03-12T13:11:52.000Z",
    "channelId": "CHANNEL_ID",
    "title": "Test",
    "description": "Live stream",
    "thumbnails": {
     "default": {
      "url": "URL",
      "width": 120,
      "height": 90
     },
     "medium": {
      "url": "URL",
      "width": 320,
      "height": 180
     },
     "high": {
      "url": "URL",
      "width": 480,
      "height": 360
     },
     "standard": {
      "url": "URL",
      "width": 640,
      "height": 480
     }
    },
    "scheduledStartTime": "2018-03-12T13:26:23.000Z",
    "isDefaultBroadcast": false,
    "liveChatId": "LIVE_CHAT_ID"
   },
   "status": {
    "lifeCycleStatus": "ready",
    "privacyStatus": "private",
    "recordingStatus": "notRecording"
   },
   "contentDetails": {
    "boundStreamId": "BOUND_STREAM_ID",
    "boundStreamLastUpdateTimeMs": "2018-03-12T13:26:19.065Z",
    "monitorStream": {
     "enableMonitorStream": false
    },
    "enableEmbed": false,
    "enableDvr": true,
    "enableContentEncryption": false,
    "startWithSlate": false,
    "recordFromStart": true,
    "enableClosedCaptions": false,
    "closedCaptionsType": "closedCaptionsDisabled",
    "enableLowLatency": true,
    "latencyPreference": "low",
    "projection": "rectangular",
    "enableAutoStart": false
   }

我用常量替换了一些私有细节(但它们都是有效的)。

我想从准备好转为现场,这似乎很简单。不幸的是我收到错误invalidTransition

{
  "code" : 403,
  "errors" : [ {
    "domain" : "youtube.liveBroadcast",
    "message" : "Invalid transition",
    "reason" : "invalidTransition",
    "extendedHelp" : "https://developers.google.com/youtube/v3/live/docs/liveBroadcasts/transition#params"
  } ],
  "message" : "Invalid transition"
}

这看起来很奇怪,每次遇到它我都想知道为什么我不能从ready转到live。同时我想知道为什么我不能回到状态created并删除boundBroadcast。

任何人都知道从这个州过渡到live的任何方式吗?

0 个答案:

没有答案