Search code examples
video.jsazure-media-servicesdrmfairplay

FairPlay license URL in Azure Media Services


I'm working on a project where I need to set up DRM content protection for my videos. It's working fine for Widevine and PlayReady and now I need to configure FairPlay.

I followed the instructions in the FPS Credential Creation Guide, so I have the certificate and the ASk. I created the content key policy option, following this guide: Apple FairPlay license requirements and configuration. Using the CLI, I can see that it has the ask, fairPlayPfx and fairPlayPfxPassword defined.

I'm using the Predefined_MultiDrmStreaming streaming policy and I have a streaming locator that returns five streaming URLs (two for DASH, two for HLS and one for SmoothStreaming).

I'm using video-js and videojs-contrib-eme to play the video. To configure the FairPlay keySystems, I need the certificate URL and the FairPlay license URL, according to the documentation: Get Certificate/License by URL.

My problem is that I don't know where to find that license URL. I checked the HLS manifest file and it's not there. I'm using the default Azure Media Services license service, so I'm not overriding the customLicenseAcquisitionUrlTemplate in the streaming policy.

Thank you in advance!

-- edit --

My manifest(format=m3u8-cmaf,encryption=cbcs-aapl) file:

#EXTM3U
#EXT-X-VERSION:7
#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="audio",NAME="aac_und_2_127998_2_1",LANGUAGE="und",DEFAULT=YES,AUTOSELECT=YES,CHANNELS="2",URI="QualityLevels(127998)/Manifest(aac_und_2_127998_2_1,format=m3u8-cmaf,encryption=cbcs-aapl)"
#EXT-X-STREAM-INF:BANDWIDTH=239626,RESOLUTION=320x180,CODECS="avc1.64000d,mp4a.40.2",AUDIO="audio"
QualityLevels(90502)/Manifest(video,format=m3u8-cmaf,encryption=cbcs-aapl)
#EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=239626,RESOLUTION=320x180,CODECS="avc1.64000d",URI="QualityLevels(90502)/Manifest(video,format=m3u8-cmaf,type=keyframes,encryption=cbcs-aapl)"
#EXT-X-STREAM-INF:BANDWIDTH=310148,RESOLUTION=480x270,CODECS="avc1.640015,mp4a.40.2",AUDIO="audio"
QualityLevels(159506)/Manifest(video,format=m3u8-cmaf,encryption=cbcs-aapl)
#EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=310148,RESOLUTION=480x270,CODECS="avc1.640015",URI="QualityLevels(159506)/Manifest(video,format=m3u8-cmaf,type=keyframes,encryption=cbcs-aapl)"
#EXT-X-STREAM-INF:BANDWIDTH=413000,RESOLUTION=640x360,CODECS="avc1.64001e,mp4a.40.2",AUDIO="audio"
QualityLevels(260144)/Manifest(video,format=m3u8-cmaf,encryption=cbcs-aapl)
#EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=413000,RESOLUTION=640x360,CODECS="avc1.64001e",URI="QualityLevels(260144)/Manifest(video,format=m3u8-cmaf,type=keyframes,encryption=cbcs-aapl)"
#EXT-X-STREAM-INF:BANDWIDTH=633193,RESOLUTION=960x540,CODECS="avc1.64001f,mp4a.40.2",AUDIO="audio"
QualityLevels(475597)/Manifest(video,format=m3u8-cmaf,encryption=cbcs-aapl)
#EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=633193,RESOLUTION=960x540,CODECS="avc1.64001f",URI="QualityLevels(475597)/Manifest(video,format=m3u8-cmaf,type=keyframes,encryption=cbcs-aapl)"
#EXT-X-STREAM-INF:BANDWIDTH=138973,CODECS="mp4a.40.2",AUDIO="audio"
QualityLevels(127998)/Manifest(aac_und_2_127998_2_1,format=m3u8-cmaf,encryption=cbcs-aapl)

My manifest(format=m3u8-aapl,encryption=cbcs-aapl) file:

#EXTM3U
#EXT-X-VERSION:5
#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="audio",NAME="aac_und_2_127998_2_1",LANGUAGE="und",DEFAULT=YES,AUTOSELECT=YES,URI="QualityLevels(127998)/Manifest(aac_und_2_127998_2_1,format=m3u8-aapl)"
#EXT-X-STREAM-INF:BANDWIDTH=239626,RESOLUTION=320x180,CODECS="avc1.64000d,mp4a.40.2",AUDIO="audio"
QualityLevels(90502)/Manifest(video,format=m3u8-aapl)
#EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=239626,RESOLUTION=320x180,CODECS="avc1.64000d",URI="QualityLevels(90502)/Manifest(video,format=m3u8-aapl,type=keyframes)"
#EXT-X-STREAM-INF:BANDWIDTH=310148,RESOLUTION=480x270,CODECS="avc1.640015,mp4a.40.2",AUDIO="audio"
QualityLevels(159506)/Manifest(video,format=m3u8-aapl)
#EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=310148,RESOLUTION=480x270,CODECS="avc1.640015",URI="QualityLevels(159506)/Manifest(video,format=m3u8-aapl,type=keyframes)"
#EXT-X-STREAM-INF:BANDWIDTH=413000,RESOLUTION=640x360,CODECS="avc1.64001e,mp4a.40.2",AUDIO="audio"
QualityLevels(260144)/Manifest(video,format=m3u8-aapl)
#EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=413000,RESOLUTION=640x360,CODECS="avc1.64001e",URI="QualityLevels(260144)/Manifest(video,format=m3u8-aapl,type=keyframes)"
#EXT-X-STREAM-INF:BANDWIDTH=633193,RESOLUTION=960x540,CODECS="avc1.64001f,mp4a.40.2",AUDIO="audio"
QualityLevels(475597)/Manifest(video,format=m3u8-aapl)
#EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=633193,RESOLUTION=960x540,CODECS="avc1.64001f",URI="QualityLevels(475597)/Manifest(video,format=m3u8-aapl,type=keyframes)"
#EXT-X-STREAM-INF:BANDWIDTH=138973,CODECS="mp4a.40.2",AUDIO="audio"
QualityLevels(127998)/Manifest(aac_und_2_127998_2_1,format=m3u8-aapl)

Solution

  • I managed to get the license URL in the manifest file. I had to create a custom streaming policy with the allowPersistentLicense set to true in the FairPlay DRM configuration. The Predefined_MultiDrmStreaming streaming policy has that value set to false.