該文檔說:YouTube API:如何獲取liveChatId?
「liveChatId參數指定將返回消息的聊天的ID。與廣播相關的實時聊天ID將在liveBroadcast資源的snippet.liveChatId屬性中返回。
但是,當使用API Explorer和youtube.liveBroadcasts.list獲取liveBroadcast的片段時,返回結果中沒有liveChatId屬性。
我使用下面的URI(略鍵):
https://www.googleapis.com/youtube/v3/liveBroadcasts?part=snippet&mine=true
我在做什麼錯?
下面是響應(一些值與...替換):
{
"kind": "youtube#liveBroadcastListResponse",
"etag": "...",
"pageInfo": {
"totalResults": 1,
"resultsPerPage": 5
},
"items": [
{
"kind": "youtube#liveBroadcast",
"etag": "...",
"id": "...",
"snippet": {
"publishedAt": "2016-04-18T17:04:24.000Z",
"channelId": "...",
"title": "...",
"description": "...",
"thumbnails": {
"default": {
"url": "...",
"width": 120,
"height": 90
},
"medium": {
"url": "...",
"width": 320,
"height": 180
},
"high": {
"url": "...",
"width": 480,
"height": 360
},
"standard": {
"url": "...",
"width": 640,
"height": 480
},
"maxres": {
"url": "...",
"width": 1280,
"height": 720
}
},
"scheduledStartTime": "1970-01-01T00:00:00.000Z",
"actualStartTime": "2016-04-18T17:04:24.250Z",
"isDefaultBroadcast": false
}
}
]
}
還有一個活動對話上發生在請求的時間的流。
顯然,使用「現在直播」創建的直播不包含liveChatId,即使它們包含實時聊天。
有沒有辦法讓liveChatId進行「Stream Now」直播?
你可以發佈你從YouTube獲得的樣本回復嗎?你確定你正在列出一個已經開始的事件並且有一個有效的聊天室/ ID嗎? – JAL
用請求的信息更新了帖子。實時廣播是流式傳輸,聊天室在請求時處於活動狀態。如果我不是流媒體,那麼正如預期的那樣,響應中沒有任何項目。 –
你在說liveBroadcast的liveChatId或用戶的liveChatId(禁止或刪除)嗎? – noogui