Queries the playback URL of a video or audio file by its ID.
Operation Description
- You can use the ID of a media file to query the playback URL of the file. After you integrate ApsaraVideo Player SDK for URL-based playback or a third-party player, you can use the obtained playback URLs to play audio and video files.
- Only videos in the Normal state can be played. The Status parameter in the response indicates the status of the video. For more information, see Overview.
- If video playback fails, you can call the GetMezzanineInfo operation to check whether the video source information is correct.
QPS limits
You can call this operation up to 360 times per second per account. Requests that exceed this limit are dropped and you will experience service interruptions. We recommend that you take note of this limit when you call this operation. For more information, see QPS limit on API operations.
Authorization information
The following table is the authorization information corresponding to the API, which can be found in the RAM permission policy statement.Action
Used in the element to grant the RAM user or RAM role permission to call this API. The specific instructions are as follows:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All resources
is used in the Resource type column of the operation.
- Condition keyword: refers to the condition keyword defined by the cloud product itself.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operate | access level | Resource type | conditional keyword | Association operation |
---|---|---|---|---|
vod:GetPlayInfo | Read |
|
| without |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
VideoId | string | Yes | The ID of the audio or video file. You can use one of the following methods to obtain the ID of the file:
| 93ab850b4f654b6e91d24d81d44**** |
Formats | string | No | The format of the media stream. Separate multiple formats with commas (,). Valid values:
NoteBy default, ApsaraVideo VOD returns video streams in all the preceding formats. However, video streams in the MPD format are returned only if the MPD container format is specified in the transcoding template. For more information, see the Container parameter in the TranscodeTemplate table. | mp4,m3u8 |
AuthTimeout | long | No | The validity period of the playback URL. Unit: seconds.
| 1800 |
OutputType | string | No | The type of the output URL. Default value: oss. Valid values:
| cdn |
StreamType | string | No | The type of the media stream. Separate multiple types with commas (,). Valid values:
By default, video and audio streams are returned. | video |
ReAuthInfo | string | No | The CDN reauthentication configuration. The value is a JSON string. If CDN reauthentication is enabled, you can use this parameter to specify the UID and rand fields for URL authentication. For more information, see URL authentication. | {"uid":"12345","rand":"abckljd"} |
Definition | string | No | The quality of the video stream. Separate multiple qualities with commas (,). Valid values:
NoteBy default, ApsaraVideo VOD returns video streams in all preceding qualities. However, video streams for adaptive bitrate streaming are returned only if the PackageSetting parameter is specified in the transcoding template. For more information, see the PackageSetting parameter in the TranscodeTemplate table. | LD |
ResultType | string | No | The type of the data to return. Default value: Single. Valid values:
| Single |
PlayConfig | string | No | The custom playback configuration. The value is a JSON string. For more information, see PlayConfig. Note PlayDomain in PlayConfig, the default domain name configured in ApsaraVideo VOD is used in this operation. If no default domain name is configured, the domain names are queried in reverse chronological order based on the time when the domain names were modified. The domain name that was last modified is used as the streaming domain name. To prevent domain name issues, we recommend that you specify the default streaming domain name. You can log on to the ApsaraVideo VOD console and choose Configuration Management > Media Management > Storage > Manage > Origin Domain Name to set the default streaming domain name.Note EncryptType parameter in PlayConfig is set to AliyunVoDEncryption , the playback URL of the stream encrypted by using proprietary cryptography is not returned to ensure video security. If you want to return such URL, you must set the ResultType parameter to Multiple . | {"PlayDomain":"vod.test_domain","XForwardedFor":"yqCD7Fp1uqChoVj/sl/p5Q==","PreviewTime":"20","MtsHlsUriToken":"yqCD7Fp1uqChoVjslp5Q"} |
AdditionType | string | No | The URL of the masked live comment data. Set the value to danmu. NoteThis parameter takes effect only when the outputType parameter is set to cdn. | danmu |
Response parameters
Example
Normal return example
JSON
Format
{
"RequestId": "F552E596-967D-5500-842F-17E6364****",
"VideoBase": {
"CreationTime": "2017-06-26T06:38:48Z",
"Status": "Normal",
"VideoId": "93ab850b4f654b6e91d24d81d44****",
"CoverURL": "http://example.aliyundoc.com/sample.jpg?auth_key=2333232-atb****",
"Duration": "3.1667",
"Title": "ApsaraVideo VOD\n",
"MediaType": "video",
"DanMuURL": "http://example.aliyundoc.com/****?auth_key=abdf2123-6783232****"
},
"PlayInfoList": [
{
"CreationTime": "2022-04-18T07:37:15Z",
"Status": "Normal",
"Specification": "H264.LD",
"NarrowBandType": "0",
"Height": 640,
"Bitrate": "450.878",
"ModificationTime": "2022-04-20T06:32:19Z",
"WatermarkId": "dgfn26457856****",
"Encrypt": 1,
"Definition": "LD",
"EncryptType": "AliyunVoDEncryption",
"StreamType": "video",
"JobId": "80e9c6580e754a798c3c19c59b16****",
"Size": 418112,
"Width": 360,
"Fps": "25",
"Duration": "9.0464",
"PlayURL": "https://example.aliyundoc.com/d52ee123f331466aabf6ab32a93d****/a777f9e24e6e47a2a942467d5c38ea37-8ee8e04293c6657fdda282bc422704****.m3u8",
"Format": "m3u8",
"HDRType": "HLG",
"BitDepth": 8
}
]
}
Error codes
For a list of error codes, visit the API error center.
Change history
Change time | Summary of changes | Operate | ||
---|---|---|---|---|
2021-12-23 | The response structure of the API operation has changed | |||
| ||||
2021-11-16 | The response structure of the API operation has changed | |||
|