If you want to implement encrypted playback, you can enable parameter pass-through for HTTP Live Streaming (HLS) encryption. This topic introduces the parameter pass-through for HLS encryption feature and describes how to enable this feature.
Overview
Parameter pass-through for HLS encryption allows you to enable HLS encryption and rewrite M3U8 files. After you enable HLS encryption, you can add a custom parameter name to the M3U8 file. The custom parameter name must be the same as that in client requests. If you do not customize a parameter name, the parameter name MtsHlsUriToken
is used by default.
To rewrite the M3U8 file for HLS encryption, Alibaba Cloud CDN rewrites the #EXT-X-KEY
tag in the M3U8 file. After the #EXT-X-KEY
tag is rewritten, the specified parameter name and value are added to the end of the URI attribute in the tag. Client requests contain the parameter name and value.
Procedure
Log on to the ApsaraVideo VOD console.
In the left-side navigation pane of the ApsaraVideo VOD console, find Configuration Management.
Choose CDN Configuration > Domain Names to go to the Domain Names page.
Find the required domain and click Configure.
Click Video Related and turn on Parameter Pass-through for HLS Encryption.
NoteAfter you enable parameter pass-through for HLS encryption, the
MtsHlsUriToken
parameter will be overwritten in decryption requests when users attempt to play HLS-encrypted videos.
Example
MtsHlsUriToken
is used by default.A client request contains the MtsHlsUriToken
parameter. The value of this parameter is test
. To decrypt the M3U8 file, Alibaba Cloud CDN adds MtsHlsUriToken=test
to the end of the URI attribute in the #EXT-X-KEY
tag.
Alibaba Cloud Gov Cloud does not support parameter pass-through for HLS encryption.