Request parameter descriptions
Parameter descriptions and configuration examples for PlayConfig, ReAuthInfo, UserData, SpriteSnapshotConfig, and EncryptConfig in ApsaraVideo VOD APIs.
Custom playback settings: PlayConfig
Parameter descriptions
A JSON string that specifies custom settings for media playback, such as a playback domain name. Supported fields:
|
Field name |
Type |
Required |
Description |
|
PlayDomain |
String |
No |
The playback domain name. If multiple origin fetch domain names are configured, specify one to play the video. If the specified domain name does not exist, the default domain name is used. Example: |
|
XForwardedFor |
String |
No |
The originating client IP address, used for scenarios such as secure IP address authentication. ApsaraVideo VOD obtains the client IP address from this field after a request passes through multiple proxy servers. The IP address is encrypted using Example: yqCD7Fp1uqChoVj/sl/p5Q== |
|
PreviewTime |
String |
No |
The preview duration in seconds. Valid values: 1 to the total video duration. If not specified, the entire video is playable. To enable previewing, see Preview videos. |
|
MtsHlsUriToken |
String |
No |
The MtsHlsUriToken generated by your token service. Used for HLS-encrypted video playback to protect the decryption key. HLS encryption. |
|
EncryptType |
String |
No |
The encryption type. Filters playback streams by encryption status. Valid values:
Note
For information about the usage and limits of encrypted stream URLs, see Obtain URLs in advance through event notifications. |
|
StorageClass |
String |
No |
The storage class filter. Returns playback streams of the specified storage class. Valid values:
|
Configuration example
PlayConfig={
"PlayDomain": "vod.test_domain",
"XForwardedFor": "yqCD7Fp1uqChoVj/sl/p5Q==",
"PreviewTime": "20",
"MtsHlsUriToken": "yqCD7Fp1uqChoVjslp5Q",
"StorageClass": "Standard"
}
CDN reauthentication settings: ReAuthInfo
Parameter descriptions
A JSON string that specifies CDN reauthentication parameters during media playback. Sets the `uid` and `rand` fields for signed URLs. Supported fields:
|
Field name |
Type |
Required |
Description |
|
uid |
String |
No |
A custom parameter. Default value: 0. |
|
rand |
String |
No |
A random number. Default value: 0. Use a UUID or similar method to ensure URL uniqueness. |
Configuration example
ReAuthInfo={
"uid": "12345",
"rand": "abckljd"
}
Custom upload settings: UserData
Parameter descriptions
A JSON string that specifies custom settings for media uploads, such as message callbacks.
Supported fields:
|
Field name |
Type |
Required |
Description |
|
MessageCallback |
String |
No |
The message callback settings (JSON object). Overrides global event notification settings when specified. Configure multiple webhooks. Parameter descriptions:
Example values:
|
|
Extend |
String |
No |
A custom extension field (JSON object). Passed through and returned in callbacks. Maximum length: 512 bytes. Note
Avoid special characters such as $, /, and \\ in the extension field. If required, Base64-encode the value before setting it and decode it upon retrieval. |
|
AccelerateConfig |
String |
No |
The upload acceleration settings (JSON object). Example: {"Type":"oss","Domain":"https://oss-accelerate.aliyuncs.com"}. `Type` specifies the acceleration method (only `oss` is supported). `Domain` specifies the accelerated domain name corresponding to an OSS region and endpoint. Default protocol: HTTPS. Note
Activate upload acceleration before use. For activation and billing details, see Upload acceleration. |
Configuration example
UserData={
"MessageCallback": {
"MNSEndpoint":"http://174809843091****.mns.cn-beijing.aliyuncs.com",
"MNSQueueName":"vod-callback-bj",
"CallbackType": "mns"
},
"Extend": {
"localId": "xxx",
"test": "www"
},
"AccelerateConfig": {
"Type": "oss",
"Domain": "https://oss-accelerate.aliyuncs.com"
}
}
Encryption configuration: EncryptConfig
Standard encryption configuration. Supported fields:
|
Field name |
Type |
Required |
Description |
|
CipherText |
String |
Yes |
The data key ciphertext, used to obtain the plaintext data key. Set to the |
|
DecryptKeyUri |
String |
Yes |
The URI to obtain the decryption key. Combines the decryption service address with the Build your own decryption service. Example with address
|
|
KeyServiceType |
String |
Yes |
The key service type. Default value: `KMS` (Alibaba Cloud Key Management Service). |
Sprite snapshot configuration: SpriteSnapshotConfig
|
Field name |
Type |
Required |
Description |
|
CellWidth |
String |
No |
The sub-image width. Default: snapshot output width. Unit: px. |
|
CellHeight |
String |
No |
The sub-image height. Default: snapshot output height. Unit: px. |
|
Padding |
String |
No |
The sub-image padding. Default value: 0. Unit: px. |
|
Margin |
String |
No |
The sub-image margin. Default value: 0. Unit: px. |
|
Color |
String |
No |
The sprite background color. Default value: Black. |
|
Columns |
String |
No |
The number of sub-image columns. Valid values: 1 to 10000. Default value: 10. |
|
Lines |
String |
No |
The number of sub-image rows. Valid values: 1 to 10000. Default value: 10. |
|
KeepCellPic |
String |
No |
Whether to retain sub-images. Valid values:
Default value: keep. |
To use default values for all SpriteSnapshotConfig parameters, pass an empty JSON string: {}.