BMPFairplayConfig
Objective-C
@interface BMPFairplayConfig : BMPDrmConfig
Swift
class FairplayConfig : DrmConfig
Represents a FairPlay Streaming DRM config.
-
The URL to the FairPlay Streaming certificate of the license server.
Declaration
Objective-C
@property (nonatomic, strong, nullable) NSURL *certificateUrl;Swift
var certificateUrl: URL? { get set } -
A dictionary to specify custom HTTP headers for the license request.
Declaration
Objective-C
@property (nonatomic, strong, nullable) NSDictionary<NSString *, NSString *> *licenseRequestHeaders;Swift
var licenseRequestHeaders: [String : String]? { get set } -
A dictionary to specify custom HTTP headers for the certificate request.
Declaration
Objective-C
@property (nonatomic, strong, nullable) NSDictionary<NSString *, NSString *> *certificateRequestHeaders;Swift
var certificateRequestHeaders: [String : String]? { get set } -
A block to prepare the data which is sent as the body of the POST license request. As many DRM providers expect different, vendor-specific messages, this can be done using this user-defined block.
Declaration
Objective-C
@property (nonatomic, copy, nullable) NSData *_Nonnull (^) (NSData *_Nonnull, NSString *_Nonnull) prepareMessage;Swift
var prepareMessage: ((Data, String) -> Data)? { get set } -
A block to prepare the contentId, which is sent to the FairPlay Streaming license server as request body, and which is used to build the SPC data. As many DRM providers expect different, vendor-specific messages, this can be done using this user-defined block. The parameter is the skd:// URI extracted from the HLS manifest (m3u8) and the return value should be the contentID as string.
Declaration
Objective-C
@property (nonatomic, copy, nullable) NSString *_Nonnull (^) (NSString *_Nonnull) prepareContentId;Swift
var prepareContentId: ((String) -> String)? { get set } -
A block to prepare the loaded certificate before building SPC data and passing it into the system. This is needed if the server responds with anything else than the certificate, e.g. if the certificate is wrapped into a JSON object. The server response for the certificate request is passed as parameter “as is”.
Declaration
Objective-C
@property (nonatomic, copy, nullable) NSData *_Nonnull (^) (NSData *_Nonnull) prepareCertificate;Swift
var prepareCertificate: ((Data) -> Data)? { get set } -
A block to prepare the loaded CKC Data before passing it to the system. This is needed if the server responds with anything else than the license, e.g. if the license is wrapped into a JSON object.
Declaration
Objective-C
@property (nonatomic, copy, nullable) NSData *_Nonnull (^) (NSData *_Nonnull) prepareLicense;Swift
var prepareLicense: ((Data) -> Data)? { get set } -
A block to prepare the URI (without the
skd://) from the HLS manifest before passing it to the system.Declaration
Objective-C
@property (nonatomic, copy, nullable) NSString *_Nonnull (^) (NSString *_Nonnull) prepareLicenseServerUrl;Swift
var prepareLicenseServerUrl: ((String) -> String)? { get set } -
A block to prepare the loaded CKC data received by the Sync SPC call to the respective Key Security Module (KSM). This data may contain information about the expiration dates of a DRM license.
Declaration
Objective-C
@property (nonatomic, copy, nullable) BMPDrmLicenseInformation *_Nonnull (^)(NSData *_Nonnull) prepareOfflineDrmLicenseInformation;Swift
var prepareOfflineDrmLicenseInformation: ((Data) -> DrmLicenseInformation)? { get set } -
A block to prepare the data which is sent as the body of the POST request for syncing the DRM license information.
Declaration
Objective-C
@property (nonatomic, copy, nullable) NSData *_Nonnull (^) (NSData *_Nonnull, NSString *_Nonnull) prepareSyncMessage;Swift
var prepareSyncMessage: ((Data, String) -> Data)? { get set } -
A block to provide the license for the given
assetId.This should only be used when the license is stored locally. If the block returns
nilwe will try to fetch the license using the available information in the sameFairplayConfiginstance. If nocertificateUrlis present at this point we will emit aSourceErrorEvent.@Note: Use this block for the following use-cases:
- License caching during playback or for future playback sessions.
- Providing the license for an already locally available content which can be provided using the
SourceType.movpkg
IMPORTANT: In both use-cases, it’s required that the license is persistable on the device. Playback will fail otherwise.
If the provided license is expired playback will fail. License duration handling has to be handled by the application.
Declaration
Objective-C
@property (nonatomic, copy, nullable) NSData *_Nullable (^) (NSString *_Nonnull) provideLicenseData;Swift
var provideLicenseData: ((String) -> Data?)? { get set } -
A block to enable custom persisting of license data for the given
assetId.@Note: Use this block for the following use-cases:
- To store the license data locally for future playback sessions.
- To update the license during a playback session if the license requires updating.
MPORTANT: In both use-cases, it’s required that the license is persistable on the device. Playback will fail otherwise.
Declaration
Objective-C
@property (nonatomic, copy, nullable) void (^) (NSString *_Nonnull, NSData *_Nonnull) persistLicenseData;Swift
var persistLicenseData: ((String, Data) -> Void)? { get set } -
Creates a new FairPlay Streaming config based on the given license URL and certificate URL.
Declaration
Objective-C
- (nonnull instancetype)initWithLicenseUrl:(nullable NSURL *)licenseUrl certificateURL:(nonnull NSURL *)certificateUrl;Swift
init(license licenseUrl: URL?, certificateURL certificateUrl: URL)Parameters
licenseUrlThe URL to the license server.
certificateUrlThe URL to the FairPlay Streaming certificate of the license server.
Return Value
A new FairPlay Streaming config initialized with the given licenseURL and certificateURL.
-
Creates a new FairPlay Streaming config based on the given certificate URL.
Declaration
Objective-C
- (nonnull instancetype)initWithCertificateURL:(nonnull NSURL *)certificateUrl;Swift
init(certificateURL certificateUrl: URL)Parameters
certificateUrlThe URL to the FairPlay Streaming certificate of the license server.
Return Value
A new FairPlay Streaming config initialized with the given cerfificateURL. The license URL defaults to nil.
-
Creates a new FairPlay Streaming config based on the given
provideLicenseDatacallback.@Note: IMPORTANT: It’s required that the license is persistable on the device. Playback will fail otherwise.
Declaration
Objective-C
- (nonnull instancetype)initWithProvideLicenseDataCallback: (nonnull NSData *_Nullable (^)(NSString *_Nonnull)) provideLicenseDataCallback;Swift
init(provideLicenseDataCallback: @escaping (String) -> Data?)Parameters
provideLicenseDataCallbackA block to provide the license for the given
assetId.Return Value
A new FairPlay Streaming config initialized with the given provideLicenseData callback. The license and certificate URL defaults to nil.
BMPFairplayConfig Class Reference