This topic describes how to configure parameter pass-through for HTTP Live Streaming (HLS) encryption.
Overview
The parameter pass-through for HLS encryption feature rewrites the M3U8 file (media playlist) for content delivered over HLS (HTTP Live Streaming).
HLS standard encryption rewriting modifies the #EXT-X-KEY tag in an HLS M3U8 file. After the tag is successfully rewritten, a parameter is appended to the end of the URI in the #EXT-X-KEY tag. The value of this parameter is carried in the client request. The default name of the parameter is MtsHlsUriToken.
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 cross-origin resource sharing.
Procedure
-
Log on to the ApsaraVideo VOD console.
-
In the left-side navigation pane, click Configuration Management.
-
Choose CDN Configuration > Domain Names.
-
Find the domain name that you want to manage and click Configure in the Actions column.
-
In the left-side navigation pane for the domain, click Video Related.
-
In the Encrypted Playback section, turn on the Parameter Pass-through for HLS Encryption switch. On this page, you can also configure other settings, such as Range Back-to-Origin and Seeking. When the Parameter Pass-through for HLS Encryption switch is enabled, the
MtsHlsUriTokenauthentication parameter is added to requests.
After you enable this feature, it provides token-based authentication by rewriting an authentication parameter. The default name of this parameter is MtsHlsUriToken.
Configuration example
When you enable Parameter Pass-through for HLS Encryption in the ApsaraVideo VOD console, the default parameter name is MtsHlsUriToken.
If a client request contains the MtsHlsUriToken parameter with a value of test, the system appends MtsHlsUriToken=test to the end of the URI in the #EXT-X-KEY tag of the M3U8 file during playback.
Alibaba Cloud Gov Cloud does not support parameter pass-through for HLS encryption.