On-Demand Screenshot Callback
Description
After developers complete media file transcoding through the Start On-Demand Screenshot interface, they can query screenshot information through this callback.
Callback instructions
- Request method: POST.
The callback data format is JSON. You need to perform UrlDecode decoding on it.
- Request URL: Please contact ZEGOCLOUD Technical Support to configure the callback URL.
- Transfer protocol: HTTPS/HTTP. HTTPS is recommended.
Callback parameters
| Common parameters | Type | Description |
|---|---|---|
| event | String | Callback event. This callback returns snapshot - Screenshot completed. |
| appid | String | Unique identifier of the App. |
| timestamp | String | Server current time, Unix timestamp. |
| nonce | String | Random number. |
| signature | String | Verification string. For details, see Verification instructions. |
| Business parameters | Type | Description |
|---|---|---|
| task_id | String | Screenshot task ID, consistent with the task_id in the response result of Start On-Demand Screenshot. |
| vendor | String | CDN vendor:
|
| field_id | String | Source media file ID. This field is only available when the CDN vendor is Tencent Cloud. |
| snapshot_pic_list | Array SnapshotPicObject | JSON array format string of on-demand screenshot information list. |
| └ url | string | On-demand screenshot URL |
| └ offset | float | Time offset in the video file corresponding to this screenshot, i.e., the screenshot at how many milliseconds, unit: milliseconds. This field is only available when the CDN vendor is Tencent Cloud and under the condition of time-point screenshots. |
Data example
{
"appid": "12345",
"event": "snapshot",
"timestamp": "148150008",
"nonce": "158243",
"signature": "signature"
"task_id": "1253642700910365374",
"field_id": "abcwurywbhsfwi",
"vendor": "tencent",
"snapshot_pic_list": "[{\"url\":\"http://abc.com/1.jpg\",\"offset\":0},{\"url\":\"http://abc.com/1.jpg\",\"offset\":0}]",
}Return response
Return HTTP status code 2XX (e.g., 200) indicates success, and other responses indicate failure.
Callback retry strategy
If the ZEGO server does not receive a response, or the received HTTP status code is not 2XX (e.g., 200), it will attempt to retry, up to 5 retries. The interval between each retry request and the previous request is 2s, 4s, 8s, 16s, and 32s respectively. If the 5th retry still fails, no more retries will be made, and the callback will be lost.
