Parameter | Required | Type | Description |
appId | Yes | Integer | The VOD application AppID. |
fileId | Yes | String | The VOD file ID. |
contentInfo | Yes | Object | The content type of the specified file ID. For the structure of this parameter, see ContentInfo. Three types of content are supported: Adaptive bitrate audio/video, which may or may not be encrypted Transcoded audio/video Uploaded original audio/video |
currentTimeStamp | Yes | Integer | The current time (Unix timestamp). |
expireTimeStamp | No | Integer | The expiration time (Unix timestamp) of the distributed signature. If this parameter is left empty, the signature will never expire. |
urlAccessInfo | No | Object | The access parameters of the playback URL, including key hotlink protection parameters, the playback domain, and the protocol. For the structure of this parameter, see UrlAccessInfo. |
drmLicenseInfo | No | Object |
Parameter | Required | Type | Description |
audioVideoType | Yes | String | The type of audio/video played. Valid values: RawAdaptive : Unencrypted adaptive bitrate outputProtectedAdaptive : Private protocol- or DRM-encrypted adaptive bitrate outputTranscode : Transcoding outputOriginal : Uploaded original audio/video |
rawAdaptiveDefinition | No | Integer | The ID of the unencrypted adaptive bitrate template allowed. This parameter is valid and required if audioVideoType is RawAdaptive . |
drmAdaptiveInfo | No | Object | The ID of the encrypted adaptive bitrate template allowed. This parameter is valid and required if audioVideoType is ProtectedAdaptive . For its structure, see DRMAdaptiveInfo. |
transcodeDefinition | No | Integer | The ID of the transcoding template allowed. This parameter is valid and required if audioVideoType is Transcode . |
imageSpriteDefinition | No | Integer | |
resolutionNames | No | Array of Object | The names of different streams (different resolutions) displayed in the player. For its structure, see ResolutionNameInfo. If you do not specify this parameter or leave it empty, the following will be used: MinEdgeLength : 240, Name : 240PMinEdgeLength : 480, Name : 480PMinEdgeLength : 720, Name : 720PMinEdgeLength : 1080, Name : 1080PMinEdgeLength : 1440, Name : 2KMinEdgeLength : 2160, Name : 4KMinEdgeLength : 4320, Name : 8K |
Parameter | Required | Type | Description |
privateEncryptionDefinition | No | Integer | |
widevineDefinition | No | Integer | |
fairPlayDefinition | No | Integer |
Parameter | Required | Type | Description |
MinEdgeLength | Yes | Integer | The video short side (px). |
Name | Yes | String | The stream name. |
Parameter | Required | Type | Description |
t | No | String | The expiration time of the URL, which must be a hexadecimal string. For the valid values and other information, see the t parameter of hotlink protection.If this parameter is left empty, the URL will never expire. |
exper | No | Integer | The preview duration in decimal seconds. The preview duration cannot be shorter than 30 seconds. For the valid values and other information, see the exper parameter of hotlink protection. |
rlimit | No | Integer | The maximum number (decimal) of IP addresses allowed for playback. For the valid values and other information, see the rlimit parameter of hotlink protection. |
us | No | String | The URL ID, which uniquely identifies a link. For the valid values and other information, see the us parameter of hotlink protection. |
domain | No | String | The playback domain. If this is not specified or Default is passed in, the default distribution domain will be used. |
scheme | No | String | The playback scheme. If this is not specified or Default is passed in, the default distribution configuration will be used. Other valid values:HTTP HTTPS |
Parameter | Required | Type | Description |
persistent | No | String | Whether to allow persistent storage of DRM playback licenses by playback devices. Valid values: ON : AllowOFF : Do not allowThe default value is OFF . |
rentalDuration | No | Integer | The allowed storage time (seconds) of DRM playback licenses when persistent is ON . If this is not specified, there will be no limit on the storage time. |
forceL1TrackTypes | No | Array of String | The track type that must use the L1 security level when Widevine is used. For other track types, Widevine L3 will be used. Valid values: AUDIO : Audio tracksSD : Video tracks whose short side is smaller than 720 pxHD : Video tracks whose short side is equal to or larger than 720 px and smaller than 2160 pxUHD1 : Video tracks whose short side is equal to or larger than 2160 px and smaller than 4320 pxUHD2 : Video tracks whose short side is equal to or larger than 4320 px |
appId
to the ID of the subapplication.t
, exper
, rlimit
, and us
are the same as those of the hotlink protection.{"alg": "HS256","typ": "JWT"}
{"appId": 1255566655,"fileId": "4564972818519602447","contentInfo": {"audioVideoType": "RawAdaptive","rawAdaptiveDefinition": 10,"imageSpriteDefinition": 10},"currentTimeStamp": 1663064276,"expireTimeStamp": 1663294210,"urlAccessInfo": {"t": "6323e6b0","rlimit": 3,"us": "72d4cd1101"}}
Signature = HMACSHA256(base64UrlEncode(Header) + "." + base64UrlEncode(Payload), Key)
Token = base64UrlEncode(Header) + '.' + base64UrlEncode(Payload) + '.' + base64UrlEncode(Signature)
The token generated is the VOD player signature.base64UrlEncode
, see Base 64 Encoding with URL and Filename Safe Alphabet.appId
is 1255566655
and you want to generate a player signature for a video whose file ID is 4564972818519602447
. The other parameters are as follows:TxtyhLlgo7J3iOADIron
.1663064276
.1663294210
.6323e6b0
.72d4cd1101
.{"alg": "HS256","typ": "JWT"}
base64UrlEncode
is:
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9
.{"appId": 1255566655,"fileId": "4564972818519602447","contentInfo": {"audioVideoType": "RawAdaptive","rawAdaptiveDefinition": 10,"imageSpriteDefinition": 10},"currentTimeStamp": 1663064276,"expireTimeStamp": 1663294210,"urlAccessInfo": {"t": "6323e6b0","rlimit": 3,"us": "72d4cd1101"}}
base64UrlEncode
is:
eyJhcHBJZCI6MTI1NTU2NjY1NSwiZmlsZUlkIjoiNDU2NDk3MjgxODUxOTYwMjQ0NyIsImNvbnRlbnRJbmZvMSI6eyJhdWRpb1ZpZGVvVHlwZSI6IlJhd0FkYXB0
aXZlIiwicmF3QWRhcHRpdmVEZWZpbml0aW9uIjoxMCwiaW1hZ2VTcHJpdGVEZWZpbml0aW9uIjoxMH0sImN1cnJlbnRUaW1lU3RhbXAiOjE2NjMwNjQyNzYsImV4
cGlyZVRpbWVTdGFtcCI6MTY2MzI5NDIxMCwidXJsQWNjZXNzSW5mbyI6eyJ0IjoiNjMyM2U2YjAiLCJybGltaXQiOjMsInVzIjoiNzJkNGNkMTEwMSJ9fQ
。TxtyhLlgo7J3iOADIron
) to generate an HMAC signature:
QFcBX9830ysTzJIyZxoOlRmNb2Gqy2fns9yOfriaDI8
.eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6MTI1NTU2NjY1NSwiZmlsZUlkIjoiNDU2NDk3MjgxODUxOTYwMjQ0NyIsImNvbnRlbnRJbmZvMSI6eyJhdWRpb1ZpZGVvVHlwZSI6IlJhd0FkYXB0aXZlIiwicmF3QWRhcHRpdmVEZWZpbml0aW9uIjoxMCwiaW1hZ2VTcHJpdGVEZWZpbml0aW9uIjoxMH0sImN1cnJlbnRUaW1lU3RhbXAiOjE2NjMwNjQyNzYsImV4cGlyZVRpbWVTdGFtcCI6MTY2MzI5NDIxMCwidXJsQWNjZXNzSW5mbyI6eyJ0IjoiNjMyM2U2YjAiLCJybGltaXQiOjMsInVzIjoiNzJkNGNkMTEwMSJ9fQ.QFcBX9830ysTzJIyZxoOlRmNb2Gqy2fns9yOfriaDI8
。KEY
parameter in the key hotlink protection configuration should be used.appId
must be an integer, but the value entered is appId:"125000123"
(string); the transcoding template parameter in contentInfo
must be an integer, but the value entered is transcodeDefinition: "14011"
(string).audioVideoType
parameter in contentInfo
is set to Transocde
(typo).
Was this page helpful?