This topic describes how to configure parameter pass-through for HTTP Live Streaming (HLS) encryption.
Overview
After you enable parameter pass-through for HLS encryption, you can rewrite M3U8 files that are transmitted over HLS.
To accelerate the delivery of HLS content, Alibaba Cloud CDN rewrites the #EXT-X-KEY
tag in an M3U8 file that is transmitted over HLS. 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 to decrypt the M3U8 file. The value of the parameter is carried in the client request. By default, the MtsHlsUriToken
parameter is rewritten.
For more information about the technical principles and application scenarios of M3U8 encryption and rewrite, see M3U8 encryption and rewrite.
Prerequisites
Cross-origin resource sharing (CORS) is configured. For more information, see Configure CORS.
Procedure
Log on to the ApsaraVideo VOD console.
In the left-side navigation pane, find Configuration Management.
Choose CDN Configuration > Domain Names. The Domain Names page is displayed.
Find the domain name that you want to configure and click Configure in the Actions column.
On the page that appears, click Video Related.
In the Encrypted Playback section, turn on Parameter Pass-through for HLS Encryption.
After you enable the parameter pass-through for HLS encryption feature, the MtsHlsUriToken
parameter will be overwritten in decryption requests when users attempt to play HLS-encrypted videos.
Configuration example
After you turn on Parameter Pass-through for HLS Encryption in the ApsaraVideo VOD console, the MtsHlsUriToken
parameter 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.