Queries the playback URL of a video or audio file by its ID. After you obtain the playback URL of a file stored in ApsaraVideo VOD, you can use ApsaraVideo Player SDK for URL-based playback or use a third-party player such as a system player, open-source player, or self-developed player to play the file.
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
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",
"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 |
---|---|---|
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 |