Stream Live 提供 webhooks,在 Input 连接、断开或与 Stream Live 遇到错误时通知您的服务。
Stream Live Notifications
Who is it for?Customers who are using Stream and want to receive webhooks with the status of their videos.
Other options / filtersYou can input Stream Live IDs to receive notifications only about those inputs. If left blank, you will receive a list for all inputs.
The following input states will fire notifications. You can toggle them on or off:
live_input.connectedlive_input.disconnected
Stream subscription.
What should you do if you receive one?Stream notifications are entirely customizable by the customer. Action will depend on the customizations enabled.
-
在 Cloudflare 仪表板中,前往 Notifications(通知) 页面。
Go to Notifications ↗ -
选择 Destinations(目标) 选项卡。
-
在 Destinations(目标) 页面的 Webhooks(Webhook) 下,选择 Create(创建)。
-
输入 webhook 信息并选择 Save and Test(保存并测试)。
-
要创建通知,从 Notifications(通知) 页面选择 All Notifications(所有通知) 选项卡。
-
在 Notifications(通知) 旁边,选择 Add(添加)。
-
在产品列表中找到 Stream 并选择 Select(选择)。
-
输入名称和可选描述。
-
在 Webhooks(Webhook) 下,选择 Add webhook(添加 webhook) 并选择您新创建的 webhook。
-
选择 Next(下一步)。
-
默认情况下,您将收到所有 Live Inputs 的 webhook 通知。如果仅希望接收某些输入的 webhooks,在文本字段中输入逗号分隔的 Input ID 列表。
-
完成后,选择 Create(创建)。
{
"name": "Live Webhook Test",
"text": "Notification type: Stream Live Input\nInput ID: eb222fcca08eeb1ae84c981ebe8aeeb6\nEvent type: live_input.disconnected\nUpdated at: 2022-01-13T11:43:41.855717910Z",
"data": {
"notification_name": "Stream Live Input",
"input_id": "eb222fcca08eeb1ae84c981ebe8aeeb6",
"event_type": "live_input.disconnected",
"updated_at": "2022-01-13T11:43:41.855717910Z"
},
"ts": 1642074233
}data 对象的 event_type 属性将为 live_input.connected、live_input.disconnected 或 live_input.errored。
如果检测到输入问题,event_type 将为 live_input.errored。额外数据将在 live_input_errored json 键下,并包含下面列出的值之一的 code。
ERR_GOP_OUT_OF_RANGE– 输入 GOP 大小或关键帧间隔超出范围。ERR_UNSUPPORTED_VIDEO_CODEC– 输入视频编解码器对于所用协议不受支持。ERR_UNSUPPORTED_AUDIO_CODEC– 输入音频编解码器对于所用协议不受支持。ERR_STORAGE_QUOTA_EXHAUSTED– 账户存储配额已超出。删除旧内容或购买额外存储。ERR_MISSING_SUBSCRIPTION– 无权开始直播。请检查订阅或登录 Dash 了解详情。
{
"name": "Live Webhook Test",
"text": "Notification type: Stream Live Input\nInput ID: 2c28dd2cc444cb77578c4840b51e43a8\nEvent type: live_input.errored\nUpdated at: 2024-07-09T18:07:51.077371662Z\nError Code: ERR_GOP_OUT_OF_RANGE\nError Message: Input GOP size or keyframe interval is out of range.\nVideo Codec: \nAudio Codec: ",
"data": {
"notification_name": "Stream Live Input",
"input_id": "eb222fcca08eeb1ae84c981ebe8aeeb6",
"event_type": "live_input.errored",
"updated_at": "2024-07-09T18:07:51.077371662Z",
"live_input_errored": {
"error": {
"code": "ERR_GOP_OUT_OF_RANGE",
"message": "Input GOP size or keyframe interval is out of range."
},
"video_codec": "",
"audio_codec": ""
}
},
"ts": 1720548474,
}