如要获取观众当前对直播视频发出的评论或心情,请发送请求至:
GET /{live-video-id}/comments
GET /{live-video-id}/reactions
curl -i -X GET \
"https://graph.facebook.com/{live-video-id}/comments?access_token={access-token}"
{ "data": [ { "created_time": "2018-08-30T18:47:02+0000", "from": { "name": "Steph C.", "id": "552524095105158" }, "message": "This is such a great live stream.", "id": "911936075671494_911936769004758" }, { "created_time": "2018-08-30T18:47:17+0000", "from": { "name": "Kevin D.", "id": "552524095105158" }, "message": "Shoutout over here!", "id": "911936075671494_911936909004744" }, { "created_time": "2018-08-30T18:48:14+0000", "from": { "name": "Clay T.", "id": "552524095105158" }, "message": "Where is this place?", "id": "911936075671494_911937292338039" } ], "paging": { "cursors": { "before": "WTI5d...", "after": "WTI5d..." } } }
如要在浏览器客户端中实时接收评论和心情,请设置服务器发送事件,并向以下端点发送请求:
GET /{live-video-id}/live_comments
GET /{live-video-id}/live_reactions
注意,直播事件的主机网址为:https://streaming-graph.facebook.com
GET https://streaming-graph.facebook.com/{live-video-id}/live_comments?access_token={access-token}
: ping data: { "created_time":"2018-08-30T21:11:01+0000", "id":"911936075671494_912014908996944", "view_id":43329028, "from": { "id":"552524095105158", "name":"Kerry Fisher" }, "message":"I love this video!" } : ping : ping