Set up ME for both
If you want to use media encryption for both DASH and HLS-format segments, you'll need to set up your environment and your AMD property a little differently.
DASH support is Limited Availability
Media Encryption for DASH is currently only available to selected customers. Talk to your Akamai account team to see if you're eligible.
Ready your content
We recommend that you separate your DASH and HLS media content in different subdirectories on your origin server. For example, something like this:
<origin domain>/hls/*
<origin domain>/dash/*
Of course, the path can be more elaborate than this, but we'll be using these paths as examples in this exercise.
Ready your player
The player requirements discussed in the DASH and HLS instructions apply here, too.
Ready your AMD property
By default, the Segmented Media Protection behavior is added to the Default Rule, which applies to all requests. To support both media formats with media encryption, you need to set up a custom rule for each, add an instance of the Segmented Media Protection behavior, and configure specific match criteria:
-
Access the Segmented Media Protection behavior in the Default Rule.
-
Make sure that both HLS Encryption and DASH Encryption are set to Off.
-
Click + Rules.
-
Select the Blank Rule Template and click Insert Rule.
-
In the New Rule, select ... > Edit Name. Enter something easily recognizable like "DASH ME rule."
-
Click + Match and set the If options:
- Select Path
- Select matches one of
- Enter the following values in the field:
/AquireLicense
. This is the DASH license request path. This is a fixed value because a request for the license key components always looks to this path./dash/*
. This is the path to the separate directory of DASH-format media on your origin server.
-
Select + Behavior > Standard property behavior.
-
Type
Segment
in the Search available... field, select Segmented Media Protection and click Insert Behavior. -
Enable DASH Encryption and ensure that all other options are disabled.
-
Click + Rules.
-
Select the Blank Rule Template and click Insert Rule.
-
Rename this rule to something like "HLS ME Rule."
-
Click + Match and set the If options:
- Select Path
- Select matches one of
- Enter the following values in the field:
/serve.key
. This is the HLS license request path. This is a fixed value because a request for the license key components always looks to this path./hls/*
. This is the path to the separate directory of HLS-format media on your origin server.
-
Select + Behavior > Standard property behavior.
-
Type
Segment
in the Search available... field, select Segmented Media Protection and click Insert Behavior. -
Enable HLS Encryption and ensure that all other options are disabled.
Address caveats and known issues (Required)
Both media formats have various known issues that apply to the use of media encryption. Review them for both DASH and HLS and make sure you don't have any conflicts.
Add Token Auth (Recommended)
You should enable Token Authentication, too. It protects client access to the key file by using secure, long tokens. Enable it in the Segmented Media Protection behavior instance in the Default Rule so that it applies to all requests.
Updated about 1 year ago