JWDrmDataSource
@protocol JWDrmDataSource <NSObject>
The JWDrmDataSource protocol defines methods that get called when assistance is required to reproduce DRM encrypted content.
-
Called when the JW Player SDK realizes that a stream is DRM encrypted and requires a content identifier from the application to begin decrypting.
Declaration
Objective-C
- (void)fetchContentIdentifierForRequest:(nonnull NSURL *)loadingRequestURL forEncryption:(JWEncryption)encryption withCompletion: (nonnull void (^)(NSData *_Nonnull))completion;
Parameters
loadingRequestURL
The url of the resource being loaded.
encryption
The DRM system used (i.e. Apple FairPlay).
completion
The completion block used to provide the JW Player SDK with the content identifier. In the case of Apple FairPlay this is an opaque identifier for the content and is needed to obtain the SPC (Server Playback Context) message from the operating system.
-
Called when the JW Player SDK realizes that a stream is DRM encrypted and requires an application identifier from the application to begin decrypting.
Declaration
Objective-C
- (void)fetchAppIdentifierForRequest:(nonnull NSURL *)loadingRequestURL forEncryption:(JWEncryption)encryption withCompletion: (nonnull void (^)(NSData *_Nonnull))completion;
Parameters
loadingRequestURL
The url of the resource being loaded.
encryption
The DRM system used (i.e. Apple FairPlay).
completion
The completion block used to provide the JW Player SDK with the application identifier. In the case of Apple FairPlay this is the Application Certificate you receive after registering an FPS playback app.
-
Called when the JW Player SDK needs the content key to being decrypting.
Declaration
Objective-C
- (void)fetchContentKeyWithRequest:(nonnull NSData *)requestBytes forEncryption:(JWEncryption)encryption withCompletion: (nonnull void (^)(NSData *_Nonnull, NSDate *_Nullable, NSString *_Nullable))completion;
Parameters
requestBytes
The key request data that must be transmitted to the key vendor to obtain the content key. In the case of Apple FairPlay this is the SPC (Server Playback Context) message from the operating system which must be sent to the Key Server in order to obtain the CKC (Content Key Context) message.
encryption
The DRM system used (i.e. Apple FairPlay).
completion
The completion block used to provide the JW Player SDK with the Server Response. In the case of Apple FairPlay, the response is the content key wrapped inside an encrypted Content Key Context (the CKC message) returned by the key server. In the case of Apple FairPlay, a date for renewal of resources that expire can be specified by passing a renewal date in the completion block. When specifying a renewal date the content type (the UTI indicating the type of data contained by the response) should be specified.