BCOVFPSAuthorizationProxy Protocol Reference

Conforms to NSObject
Declared in BCOVFPSAuthorizationProxy.h

Overview

Implement this protocol when interacting with a custom FPS license server.

– contentIdentifierFromLoadingRequest:

Optional method. This method is only called when downloading a video when the license has not been preloaded prior to downloading. Implement this method to handle retrieving the content identifier from the loading request. This is called for each asset. No guarantee is made as to the thread that this is called on. You should return the content identifier corresponding to this loading request. This is typically extracted from the “skd://…” URL in loadingRequest.request.URL. The content identifier will be passed to [AVAssetResourceLoadingRequest streamingContentKeyRequestDataForApp:contentIdentifier:options:error:] to retrieve the SPC.

- (nullable NSData *)contentIdentifierFromLoadingRequest:(nonnull AVAssetResourceLoadingRequest *)loadingRequest

Parameters

loadingRequest

The skd:// loading request made for the asset.

Discussion

Optional method. This method is only called when downloading a video when the license has not been preloaded prior to downloading. Implement this method to handle retrieving the content identifier from the loading request. This is called for each asset. No guarantee is made as to the thread that this is called on. You should return the content identifier corresponding to this loading request. This is typically extracted from the “skd://…” URL in loadingRequest.request.URL. The content identifier will be passed to [AVAssetResourceLoadingRequest streamingContentKeyRequestDataForApp:contentIdentifier:options:error:] to retrieve the SPC.

If this method is not provided, the default method will be used. The default method removes “skd://” from loadingRequest.request.URL to generate the content identifier.

Declared In

BCOVFPSAuthorizationProxy.h

– contentIdentifierFromKeyRequest: required method

Implement this method to handle retrieving the content identifier from the content key request. This is called for each asset. No guarantee is made as to the thread that this is called on. You should return the content identifier corresponding to this content key request. This is typically extracted from the “skd://…” value in keyRequest.identifier. The content identifier will be passed to [AVContentKeySession makeStreamingContentKeyRequestDataForApp: contentIdentifier:options:completionHandler] to retrieve the SPC.

- (nullable NSData *)contentIdentifierFromKeyRequest:(nullable AVContentKeyRequest *)keyRequest

Parameters

keyRequest

The AVContentKeyRequest for the asset.

Discussion

Implement this method to handle retrieving the content identifier from the content key request. This is called for each asset. No guarantee is made as to the thread that this is called on. You should return the content identifier corresponding to this content key request. This is typically extracted from the “skd://…” value in keyRequest.identifier. The content identifier will be passed to [AVContentKeySession makeStreamingContentKeyRequestDataForApp: contentIdentifier:options:completionHandler] to retrieve the SPC.

Declared In

BCOVFPSAuthorizationProxy.h

– encryptedContentKeyForContentKeyIdentifier:contentKeyRequest:source:options:completionHandler: required method

Implement this method to handle retrieving the content key for a video that is being downloaded for offline playback. This is called for each asset. No guarantee is made as to the thread that this is called on.

- (void)encryptedContentKeyForContentKeyIdentifier:(nonnull NSString *)contentKeyIdentifier contentKeyRequest:(nonnull NSData *)keyRequest source:(nonnull BCOVSource *)source options:(nullable NSDictionary *)options completionHandler:(nonnull void ( ^ ) ( NSURLResponse *__nullable response , NSData *__nullable contentKey , NSDate *__nullable expirationDate , NSError *__nullable error ))completionHandler

Parameters

contentKeyIdentifier

The “skd://…” loading request URL string made for the asset.

keyRequest

The key request data returned by [AVAssetResourceLoadingRequest streamingContentKeyRequestDataForApp:contentIdentifier:options:error:].

source

The BCOVSource used to make this request

options

The parameters originally passed to -BCOVOfflineVideoManager requestVideoDownload:mediaSelections:parameters:completion:

completionHandler

The completion handler to return the content key. If returning an error, you must leave the contentkey and response parameters nil.

Discussion

Implement this method to handle retrieving the content key for a video that is being downloaded for offline playback. This is called for each asset. No guarantee is made as to the thread that this is called on.

Declared In

BCOVFPSAuthorizationProxy.h