Obtains the playback URL by the audio or video ID. Then, you can use ApsaraVideo Player or a third-party player, such as a system player, open source player, orself-developed player, to play the audio or video.
Operation description
- Make sure that you understand the billing method and price of ApsaraVideo VOD before you call this operation. You are charged for outbound traffic when you download or play videos based on URLs in ApsaraVideo VOD. For more information about billing of outbound traffic, see Billing of outbound traffic. If you have configured an accelerated domain name, see Billing of the acceleration service. If you have activated the acceleration service, you are charged acceleration fees when you upload media files to ApsaraVideo VOD. For more information, see Billing of acceleration traffic.
- Only videos whose Status is Normal can be played. For more information, see Overview .
- If video playback fails, you can call the GetMezzanineInfo operation to check whether the video source information is correct.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- 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 Key: the condition key that is defined by the cloud service.
- 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.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
vod:GetPlayInfo | get | *All Resources * |
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
VideoId | string | Yes | The ID of the media file. You can specify only one ID. You can use one of the following methods to obtain the ID:
| 93ab850b4f654b6e91d24d81d44**** |
Formats | string | No | The format of the media stream. Separate multiple formats with commas (,). Valid values:
Note
dash 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 must be a JSON string. If CDN reauthentication is enabled, you can use this parameter to specify the | {"uid":"12345","rand":"abckljd"} |
Definition | string | No | The quality of the video stream. Separate multiple qualities with commas (,). Valid values:
Note
| 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 must be a JSON string. You can specify a domain name for playback. For more information, see PlayConfig . Note
PlayDomain parameter that is nested under the PlayConfig parameter, the default domain name specified in ApsaraVideo VOD is used in this operation. If no default domain name is specified, the domain names are queried in reverse chronological order based on the time when the domain names were last modified. To prevent domain name issues, we recommend that you perform the following steps to specify the default playback domain name: Log on to the ApsaraVideo VOD console. In the left-side navigation pane, choose Configuration Management > Media Management > Storage. Find the domain name that you want to configure and click Manage in the Actions column. On the page that appears, set the default playback domain name in the Origin Domain Name section.EncryptType parameter nested under the PlayConfig parameter to AliyunVoDEncryption , the playback URLs of videos encrypted by using Alibaba Cloud proprietary cryptography are not automatically returned to ensure video security. To return playback URLs of videos encrypted by using Alibaba Cloud proprietary cryptography, 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. Value: danmu. Note
This parameter takes effect only when the outputType parameter is set to cdn .
| danmu |
Trace | string | No | The custom digital watermark.
| test mark |
DigitalWatermarkType | string | No | The type of the digital watermark. Valid values:
| TraceMark |
Response parameters
Examples
Sample success responses
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****",
"StorageClass": "Standard"
},
"PlayInfoList": {
"PlayInfo": [
{
"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",
"EncryptMode": "License",
"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,
"JobType": 2,
"JobExt": "CopyrightMarkTest"
}
]
}
}
Error codes
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2024-12-09 | The response structure of the API has changed | View Change Details |
2024-10-11 | The response structure of the API has changed | View Change Details |
2023-10-18 | The request parameters of the API has changed | View Change Details |
2023-09-05 | The response structure of the API has changed | View Change Details |
2021-12-23 | The response structure of the API has changed | View Change Details |
2021-11-16 | The response structure of the API has changed | View Change Details |