Skip to content

Commit 131fe18

Browse files
Docs for on-demand thumbnails and filtered webhooks (#543)
Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
1 parent 9bba2ac commit 131fe18

2 files changed

Lines changed: 33 additions & 0 deletions

File tree

millicast/webhooks/index.mdx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,14 @@ The [Thumbnail](/millicast/webhooks/thumbnail.mdx) hook does not use this schema
158158

159159
The [ViewerConnection](/millicast/webhooks/viewerconnection.md) hook guide explains how to use viewer connection events to automate your workflow.
160160

161+
## Filtered webhooks
162+
163+
You may wish to send webhooks for different groups of streams to different webhook URLs. For example you may set up different targets for webhooks relating to different environments, customers or regions.
164+
165+
You can do this by configuring a **filter** on your webhook. A filter is a regular expression. Only events matching the filter will be sent to the webhook.
166+
167+
For event types 'feeds', 'media', 'thumbnail' and 'viewerConnection' the filter will be applied to the `streamName` data field. For event type 'transcoder' the filter will be applied to the `transcoderName` data field.
168+
161169
## Learn more
162170

163171
Learn more or find examples by exploring the [developer blog](https://optiview.dolby.com/resources/blog/tag/webhooks) and [code samples](https://github.com/orgs/dolbyio-samples/repositories?q=webhooks).

millicast/webhooks/thumbnail.mdx

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ The following HTTP headers are on the request to identify stream details:
6565
- **X-Millicast-Timestamp**: timestamp of the generated thumbnail.
6666
- **X-Millicast-Feed-Id**: Dolby.io Real-time Streaming feed id.
6767
- **X-Millicast-Stream-Id**: Dolby.io Real-time Streaming stream id.
68+
- **X-Millicast-Token-Id**: Dolby.io Real-time Streaming publish token id.
6869
- **X-Millicast-Signature**: SHA1 signature using the hook configured secret (The same signature mechanism used by the other webhooks).
6970

7071
## Troubleshooting
@@ -76,6 +77,30 @@ There are a few limitations to be aware of:
7677
- Thumbnails cannot be configured to send more or less frequently than every 30 seconds.
7778
- Regular intra frames are required to generate the thumbnails.
7879

80+
## On demand thumbnails
81+
82+
If the thumbnails generated every 30 seconds are not interesting or timed appropriately, you may instead create 'on-demand' thumbnails.
83+
Call the /api/thumbnails endpoint to immediately generate a thumbnail for a streamName and/or tokenId and send it to any configured webhooks.
84+
85+
```
86+
curl --request POST \
87+
--url https://api.millicast.com/api/thumbnails \
88+
--header 'accept: application/json' \
89+
--header 'authorization: Bearer {YOUR_API_SECRET}' \
90+
--header 'content-type: application/json' \
91+
--data '
92+
{
93+
"streamName": "myStreamName",
94+
"tokenId": 12345
95+
}
96+
'
97+
```
98+
99+
Note that the thumbnail setting on the publish token only controls the regularly scheduled thumbnails every 30 seconds and is not required for on demand thumbnails.
100+
On demand thumbnails and scheduled thumbnails may be used in parallel.
101+
102+
On demand thumbnails are rate limited to 6 per minute per streamName/tokenId combination.
103+
79104
## Learn more
80105

81106
We have some sample code to demonstrate receiving a thumbnail hook and saving it to disk: [Webhook Code Example (download and save)](https://github.com/millicast/samples-millicast-webhooks)

0 commit comments

Comments
 (0)