Queries the playback credential that is required for playing a video.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | GetVideoPlayAuth |
The operation that you want to perform. Set the value to GetVideoPlayAuth. |
VideoId | String | Yes | dfde02284a5c46622a097adaf44a**** |
The ID of the video. |
AuthInfoTimeout | Long | No | 100 |
The validity period of the playback credential. Unit: seconds.
|
ApiVersion | String | No | 1.0.0 |
The version of API. Set the value to 1.0.0. |
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
RequestId | String | E4EBD2BF-5EB0-4476-8829-9D94E1B1**** |
The ID of the request. |
VideoMeta | Struct |
The metadata of the video. |
|
CoverURL | String | https://example.aliyundoc.com/****.jpg |
The URL of the video thumbnail. |
Duration | Float | 120.0 |
The duration of the video. Unit: seconds. |
Status | String | Normal |
The status of the video. For more information about the value range and description, see the Status table. |
Title | String | ApsaraVideo VOD |
The title of the video. |
VideoId | String | dfde02284a5c46622a097adaf44a**** |
The ID of the video. |
PlayAuth | String | sstyYuew6789000000xtt7TYUh**** |
The playback credential of the video. |
Examples
Sample requests
http(s)://vod.cn-shanghai.aliyuncs.com/?Action=GetVideoPlayAuth
&VideoId=dfde02284a5c46622a097adaf44a****
&AuthInfoTimeout=100
&ApiVersion=1.0.0
&<Common request parameters>
Sample success responses
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<GetVideoPlayAuthResponse>
<PlayAuth>sstyYuew6789000000xtt7TYUh****</PlayAuth>
<RequestId>E4EBD2BF-5EB0-4476-8829-9D94E1B1****</RequestId>
<VideoMeta>
<Status>Normal</Status>
<Duration>120</Duration>
<Title>ApsaraVideo VOD</Title>
<VideoId>dfde02284a5c46622a097adaf44a****</VideoId>
<CoverURL>https://example.aliyundoc.com/****.jpg</CoverURL>
</VideoMeta>
</GetVideoPlayAuthResponse>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"PlayAuth" : "sstyYuew6789000000xtt7TYUh****",
"RequestId" : "E4EBD2BF-5EB0-4476-8829-9D94E1B1****",
"VideoMeta" : {
"Status" : "Normal",
"Duration" : 120,
"Title" : "ApsaraVideo VOD",
"VideoId" : "dfde02284a5c46622a097adaf44a****",
"CoverURL" : "https://example.aliyundoc.com/****.jpg"
}
}
Error codes
For a list of error codes, visit the API Error Center.
Common errors
The following table describes the common errors that this operation can return.
Error code |
Error message |
HTTP status code |
Description |
---|---|---|---|
Forbidden.IllegalStatus |
Status of the video is illegal. |
403 |
The error message returned because the video status is invalid. |
InvalidVideo.NotFound |
The video does not exist. |
404 |
The error message returned because the video does not exist. |
SDK examples
We recommend that you use a server SDK to call this operation. For more information about the sample code that is used to call this operation in various languages, see the following topics: