Submits a refresh or prefetch task for audio or video files by audio or video ID.
Operation description
ApsaraVideo VOD provides resource purge and prefetch features. The purge feature deletes cached resources on points of presence and forces the points of presence to retrieve the latest resources from the origin server through back-to-origin requests. The prefetch feature allows you to download and cache popular resources to points of presence before peak hours to improve access efficiency.
This operation directly submits a refresh or prefetch node by audio or video ID and supports filtering by streaming format and definition, which allows you to refresh or prefetch specific streams as needed.
You can submit a refresh or prefetch node for up to 20 audio or video files at a time.
QPS limit
The QPS limit for a single user for this operation is 50 calls per second. If the limit is exceeded, the API invocation is throttled, which may affect your business. Invoke this operation properly. For more information, see QPS limit.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
vod:RefreshMediaPlayUrls |
update |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| MediaIds |
string |
Yes |
The IDs of the audio or video files that you want to refresh or prefetch. You can specify one or more IDs. Separate multiple IDs with commas (,). You can specify up to 20 IDs. You can obtain audio or video IDs by using the following methods:
|
ca3a8f6e4957b658067095869****, a6e49sfgd23p5g9ja7095863**** |
| TaskType |
string |
Yes |
The type of the task. Valid values:
|
Preload |
| Formats |
string |
No |
The streaming formats that you want to refresh or prefetch. You can specify multiple formats. Separate multiple formats with commas (,). If you do not specify this parameter, streams in all formats are refreshed or prefetched by default. Valid values:
|
mp4,m3u8 |
| Definitions |
string |
No |
Specifies the definitions of the streams that you want to purge or prefetch. You can specify multiple definitions. Separate multiple definitions with commas (,). If you do not specify this parameter, streams in all definitions are purged or prefetched by default. Note
The value must be one of the values defined in Definition in Metric description for media assets. |
HD, SD |
| StreamType |
string |
No |
The types of the streams that you want to refresh or prefetch. You can specify multiple stream types. Separate multiple stream types with commas (,). If you do not specify this parameter, all stream types are refreshed or prefetched by default. Valid values:
|
video |
| ResultType |
string |
No |
The result type of the refresh or prefetch task. Valid values:
|
Single |
| SliceFlag |
boolean |
No |
Specifies whether to refresh or prefetch the playback URLs of TS files in M3U8 streams. Valid values:
|
false |
| SliceCount |
integer |
No |
The number of TS file playback URLs to refresh or prefetch for M3U8 streams. Only the first N TS file playback URLs of each M3U8 stream are refreshed or prefetched. Valid values: 1 to 20. Default value: 5. |
5 |
| UserData |
string |
No |
The custom settings. The value is a JSON string that supports settings such as message callbacks and upload acceleration. For more information, see UserData. Note
|
{"MessageCallback":{"CallbackURL":"http://example.aliyundoc.com"}, "Extend":{"localId":"xxx","test":"www"}} |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response parameters. |
||
| MediaRefreshJobId |
string |
The ID of the refresh or prefetch task. |
41d465e31957**** |
| NonExistMediaIds |
string |
The list of audio or video IDs that do not exist. |
ca3a8f6e4957b658067095869**** |
| ForbiddenMediaIds |
string |
The list of audio or video IDs that are forbidden. This is typically because you do not have multi-application permissions. For more information, see Multi-application. |
a6e49sfgd23p5g9ja7095863**** |
| RequestId |
string |
The request ID. |
25818875-5F78-4AF6-04D5-D7393642**** |
Examples
Success response
JSON format
{
"MediaRefreshJobId": "41d465e31957****",
"NonExistMediaIds": "ca3a8f6e4957b658067095869****",
"ForbiddenMediaIds": "a6e49sfgd23p5g9ja7095863****",
"RequestId": "25818875-5F78-4AF6-04D5-D7393642****"
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.