Configure parameter pass-through for HLS encryption to append authentication tokens to M3U8 playlist URIs.
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 rewriting, a parameter from the client request is appended to the URI in the #EXT-X-KEY tag. The default parameter name is MtsHlsUriToken.
For more information about 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.
Once enabled, this feature provides token-based authentication by rewriting an authentication parameter. The default parameter name 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.