Request parameter descriptions

Updated at:

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: "vod.test_domain".

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 AES/ECB/PKCS5Padding. To obtain the encryption key, submit a ticket.

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:

  • Unencrypted: The data is not encrypted.

  • AliyunVoDEncryption: Alibaba Cloud proprietary cryptography.

  • HLSEncryption: HLS encryption.

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:

  • Empty (default): No filtering. Returns the playback stream for Standard storage media. For non-Standard media, no playback stream is returned. For non-Standard source files, only transcoded streams are returned (not the original quality stream).

  • All: All types.

  • Standard: Standard.

  • IA: Infrequent Access (IA) for media assets.

  • Archive: Archive for media assets.

  • ColdArchive: Cold Archive for media assets.

  • SourceIA: Infrequent Access storage for source files.

  • SourceArchive: Archive for source files.

  • SourceColdArchive: Cold Archive for source files.

  • Changing: The storage class of the media asset is being changed.

  • SourceChanging: The source file is changing.

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:

  • CallbackType: The callback method. Valid values are http and mns.

  • CallbackURL: The HTTP webhook address. This parameter is required when CallbackType is set to http.

  • MNSQueueName: The name of the MNS queue. This parameter is required when CallbackType is set to mns.

  • MNSEndpoint: The endpoint of the MNS queue. This parameter is required when CallbackType is set to mns.

Example values:

  • HTTP callback: {"CallbackType":"http", "CallbackURL":"http://callback-host/addr"}

  • MNS callback: {"CallbackType":"mns","MNSQueueName":"vod-callback-bj","MNSEndpoint":"http://174809843091****.mns.cn-beijing.aliyuncs.com"}

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 CiphertextBlob value returned by the KMS GenerateDataKey operation.

DecryptKeyUri

String

Yes

The URI to obtain the decryption key. Combines the decryption service address with the Ciphertext value.

Build your own decryption service. Example with address http://demo.aliyundoc.com:

http://demo.aliyundoc.com?CipherText=ZjJmZGViNzUtZWY1Mi00Y2RlLTk3MTMt****

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:

  • keep: Retain.

  • delete: Delete.

Default value: keep.

Note

To use default values for all SpriteSnapshotConfig parameters, pass an empty JSON string: {}.