ExpressPlay
Using the ExpressPlay multi DRM API
The following sections show how to work with ExpressPlay's multi-DRM service, starting from the ExpressPlay getting started tutorial (part A).
The KID and CEK as shown below are taken from the tutorial. You can, however, find further information on how to work with keys in the key storage section on the ExpressPlay website.
MPEG_DASH
You can follow the Adding Marlin DRM documentation to learn how to pass KID and CEK. An example:
#!/bin/bash
KID=43215678123412341234123412341234
CEK=12341234123412341234123412341234
MP4SPLIT_OPTIONS+=--marlin.key=${KID}:${CEK}
$(MP4SPLIT) -o test.ism \
$(MP4SPLIT_OPTIONS) \
video.mp4
HTTP Live Streaming (HLS)
You can follow the Adding Marlin DRM documentation to learn how to pass the KID and CEK. An example:
#!/bin/bash
KID=43215678123412341234123412341234
CEK=12341234123412341234123412341234
MP4SPLIT_OPTIONS+=--marlin.key=${KID}:${CEK}
MP4SPLIT_OPTIONS+=--marlin.license_server_url=urn:marlin-drm?CID=content1234
MP4SPLIT_OPTIONS+=--hls.playout=marlin
mp4split -o video.ism \
$(MP4SPLIT_OPTIONS) \
video.mp4
The value used in the CID
is a unique string used by Marlin identifying the
content which is used again in the token generation (see below).
Playout and Token generation
For playout to function, for instance on the ExpressPlayer, a token needs to be generated as outlined in the get token tutorial.
Using the API example fo MPEG-DASH playout will look like the following:
#!/bin/bash
curl -k 'https://ms3-gen.expressplay.com/hms/ms3/token?customerAuthenticator=YOUR_CUSTOMER_ID&contentId=urn:marlin:kid:43215678123412341234123412341234&contentKey=12341234123412341234123412341234&contentURL=YOUR_MPD_URL'
The return would be something like the following:
https://ms3.test.expressplay.com:8443/hms/ms3/rights/?b=TOKEN#YOUR_MPD_URL
This url you would pass to the ExpressPlayer.
Please note that the Content ID for MPEG-DASH and HLS Marlin playout differ. Given the above example the values look like the following:
Format |
Content ID |
---|---|
MPEG-DASH |
|
HLS |
user defined string (e.g. content1234) |
Adding PlayReady DRM or Widevine DRM
Similar to Adding Widevine Modular DRM or Adding PlayReady DRM a server manifest can be created as follows that supports both:
#!/bin/bash
KID=12341234123412341234123412341234
CEK=43215678123412341234123412341234
MP4SPLIT_OPTIONS+=--iss.key=${KID}:${CEK}
MP4SPLIT_OPTIONS+=--iss.license_server_url=https://expressplay-licensing.axprod.net/LicensingService.ashx
MP4SPLIT_OPTIONS+=--widevine.key=${KID}:${CEK}
$(MP4SPLIT) -o test.ism \
$(MP4SPLIT_OPTIONS) \
video.mp4
The Widevine "pssh" box will be generated in this case.
Testing Widevine DRM
The playout token is generated differently, from the getting started tutorial (part E):
#!/bin/bash
curl -k 'https://wv-gen.expressplay.com/hms/wv/token?customerAuthenticator=YOUR_CUSTOMER_AUTHENTICATOR_CODE&errorFormat=json&kid=12341234123412341234123412341234&contentKey=43215678123412341234123412341234&securityLevel=1&hdcpOutputControl=0'
The result of this call looks like the following:
https://wv.test.expressplay.com/hms/wv/rights/?ExpressPlayToken=YOUR_TOKEN
Testing can be done with for instance the Shaka player player using the 'custom asset' option from the Asset drop down box.
The url to the MPD should be used as custom manifest, the result of the call for a token will be the custom license server.
Please note that as the Expressplay license server is hosted over HTTPS your content should also come from a HTTPS url, mixing them will not work as the Shaka player will block this.
Testing PlayReady DRM
The playout token is generated following the getting started tutorial, part E, step 4.
Testing can be done with the Silverlight player (in Safari or Firefox) from the ExpressPlay test apps page.
Please follow the ExpressPlay documentation on how to work with different PlayReady keys.