This iOS sample application demonstrates how to use Axinom DRM for the playback of HTTP Live Streaming (HLS) content protected with FairPlay Streaming (FPS). This project uses AVFoundation framework and is based on "FairPlay Streaming Programming Guide".
In order to use this sample the following prerequisities should be met:
-
Access to Apple FPS Deployment Package. This is available only to content owners and can be obtained here: https://developer.apple.com/streaming/fps/.
-
Set up Axinom DRM demo account. Registration can be performed here: https://drm.axinom.com/evaluation-account/.
-
Ability to generate Axinom DRM License Tokens. Documentation on this can be found here: https://github.com/Axinom/drm-quick-start.
AssetLoaderDelegate.m
AssetLoaderDelegate is the class that manages responding to content key requests for FairPlay Streaming protected content.
Implements communications with the Axinom DRM license server.
Attaches the license token to license requests.
mediaResource.plist
If you wish to add your own HLS streams to test with this sample, you can do this by adding an entry into the mediaResource.plist that is part of the Xcode Project. Keys you need to provide values for:
media_url: The url of the HLS stream's master playlist.
drm_license_url: Axinom DRM license server url.
X-AxDRM-Message: license token for license request.
fps_certificate_url: url to FPS certificate (from your Apple FPS Deployment Package).
Xcode 10.0 or later; iOS 12.0 SDK or later;
iOS 9.0 or later. iPhone, iPad
Important: Protected streams cannot be played back on Simulator because the delegate method -resourceLoader:shouldWaitForLoadingOfRequestedResource: only gets called when using a real device.