This topic describes the request parameters that are used in the ApsaraVideo VOD API.
PlayConfig: specifies the custom configurations for media playback
This parameter specifies the custom configurations for media playback. The value is a JSON string. You can configure media playback for a specific streaming domain. The following table describes the parameters that you can set in the PlayConfig parameter.
Parameter | Type | Required | Description |
PlayDomain | String | No | The name of the streaming domain. If multiple streaming domains are configured, you can specify one of the streaming domains to play the current video. If the specified streaming domain does not exist, the default streaming domain configured for the storage location of the current video is returned in the streaming URL. Example: |
XForwardedFor | String | No | The originating IP address of the client that initiates the request. This parameter is used to check whether the request is initiated from an IP address that is added to a review security group. For more information, see Security IP address preview. ApsaraVideo VOD can obtain the originating IP address based on this parameter after a request passes through multiple proxy servers. To ensure data security, you must encrypt the originating IP address by using the |
PreviewTime | String | No | The preview duration, in seconds. The minimum value is 1. The maximum value indicates the total duration of the video. If you do not set this parameter, the whole video is played. For more information about how to enable the preview feature, see Configure the preview feature for VOD resources. |
MtsHlsUriToken | String | No | The MtsHlsUriToken parameter that is generated by a token issuance service. You can set this parameter in scenarios in which you want to decrypt and play videos that are encrypted in Http-Live-Streaming (HLS) Encryption mode. This allows you to prevent decryption keys from being intercepted. For more information, see HLS encryption. |
EncryptType | String | No | The type of the encryption. You can set this parameter to play videos that are not encrypted or videos that are encrypted in a specific mode. Valid values:
|
Example:
PlayConfig={"PlayDomain":"vod.test_domain","XForwardedFor":"yqCD7Fp1uqChoVj/sl/p5Q==","PreviewTime":"20","MtsHlsUriToken":"yqCD7Fp1uqChoVjslp5Q"}
ReAuthInfo: specifies the configurations of CDN reauthentication for media playback
This parameter specifies the configurations of CDN reauthentication for media playback. The value is a JSON string. After you enable CDN reauthentication, you can use this parameter to set the uid and rand parameters for URL signing. The following table describes the parameters that you can set in the ReAuthInfo parameter.
Parameter | Type | Required | Description |
uid | String | No | The additional parameter, which is generally set to 0. You can set this parameter as required. |
rand | String | No | The random number, which is generally set to 0. To generate a different URL each time, you can use the UUID as the random number. |
Example:
ReAuthInfo={"uid":"12345","rand":"abckljd"}
UserData: specifies the custom configurations for media upload
This parameter specifies the custom configurations for media upload, such as the callback configurations for event notifications. The value is a JSON string.
Only HTTP callback methods are supported.
The following table describes the parameters that you can set in the UserData parameter.
Parameter | Type | Required | Description |
MessageCallback | String | No | The callback configurations for event notifications. If you set this parameter, the specified callback configurations take effect. Otherwise, the default callback configurations take effect. The data structure is JSON Object. For more information, see SetMessageCallback. Example: {"CallbackType":"http", "CallbackURL":"http://callback-host/addr"}. The CallbackType parameter specifies the callback method. The default value is http. The CallbackURL parameter specifies the callback URL. |
Extend | String | No | The custom extended field, which is transparently transmitted during a callback. The field value can be up to 512 bytes in length. The data structure is JSON Object. |
AccelerateConfig | String | No | The configurations for upload acceleration. The data structure is JSON Object. Example: {"Type":"oss","Domain":"https://oss-accelerate.aliyuncs.com"}. The Type parameter specifies the acceleration method. Set the value to oss. The Domain parameter specifies the domain name for CDN. By default, the domain name for CDN is an HTTPS URL. For more information, see Regions and endpoints. |
Example:
UserData={"MessageCallback":{"CallbackURL":"http://example.com","CallbackType":"http"}, "Extend":{"localId":"xxx","test":"www"}, "AccelerateConfig":{
"Type":"oss","Domain":"https://demo.developer.aliyundoc.com"}
EncryptConfig: specifies the configurations for HLS encryption
This parameter specifies the configurations for HLS encryption.
Parameter | Type | Required | Description |
---|---|---|---|
CipherText | String | Yes | The ciphertext key that is used to obtain the plaintext key. |
DecryptKeyUri | String | Yes | The address that is used to obtain the decryption key based on the ciphertext key. Example: |
KeyServiceType | String | Yes | The type of the key service. Default value: KMS, which indicates Key Management Service of Alibaba Cloud. |
SpriteSnapshotConfig: specifies the configurations for capturing image sprites
Parameter | Type | Required | Description |
---|---|---|---|
CellWidth | String | No | The width of the original snapshots that compose the image sprite. Default value: the width of a normal snapshot. Unit: pixel. |
CellHeight | String | No | The height of the original snapshots that compose the image sprite. Default value: the height of a normal snapshot. Unit: pixel. |
Padding | String | No | The padding of the original snapshots that compose the image sprite. Default value: 0. Unit: pixel. |
Margin | String | No | The margin of the original snapshots that compose the image sprite. Default value: 0. Unit: pixel. |
Color | String | No | The background color of the image sprite. Default value: Black. |
Columns | String | No | The number of columns for the original snapshots that compose the image sprite. Valid values: [1,10000]. Default value: 10. |
Lines | String | No | The number of rows for the original snapshots that compose the image sprite. Valid values: [1,10000]. Default value: 10. |
KeepCellPic | String | No | Specifies whether to retain the original snapshots that compose the image sprite. Valid values:
Default value: keep. |
If you want to set all the parameters in the SpriteSnapshotConfig parameter to their default values, specify an empty JSON string for the SpriteSnapshotConfig parameter.