ANURAG SINGH
ANURAG SINGH

Reputation: 31

Error while fetching Server Playback Context when downloading Fairplay enabled videos

While Implementing Offline FPS Getting AVFoundation Error -11800 I am implementing the Offline HLS using FPS.

I have downloaded the video using AVAssetDownloadDelegate Now For DRM content I need to fetch license so I have implemented the AVAssetResourceLoaderDelegate Everything is working fine in AVAssetResourceLoaderDelegate, I got the CKC or License but when I execute following code

let persistentContentKeyContext = try loadingRequest.persistentContentKey(fromKeyVendorResponse: responseData, options: nil)

I get following error

Error Domain=AVFoundationErrorDomain Code=-11800 "The operation could not be completed" UserInfo={NSLocalizedFailureReason=An unknown error occurred (-12158), NSLocalizedDescription=The operation could not be completed, NSUnderlyingError=0x1c084a6e0 {Error Domain=NSOSStatusErrorDomain Code=-12158 "(null)"}}

Can anyone please tell me what does this error codes means and how to resolve this error.

Upvotes: 1

Views: 911

Answers (1)

Mick
Mick

Reputation: 25471

Unfortunately, the error response you are seeing is not very informative as you have noticed and could cover multiple failure cases.

It is typically means that the device FairPlay service cannot properly decode the CKC that your DRM server provided to the device, or else that some of the information in it is not consistent with a persistent license.

This is a problem for you to debug as the CKC that is sent back is encrypted in a way that you will not be able to read - see diagram below from Apple showing the sequence:

enter image description here

The best way to debug and investigate this is usually to contact the provider of your DRM server (key server in the above diagram) and see if they can investigate it on the server side and decode the response they are sending to you so you can check it matches what you are expecting and the persistent period etc is correct.

Upvotes: 1

Related Questions