3

Issue:

I am supporting a streaming iOS application that uses Fairplay DRM to playback protected content.

On iOS 16 devices, I am seeing intermittent exceptions thrown when trying to process the CKC returned by the license server.

The thrown exception is as follows:

-[AVContentKeyRequest processContentKeyResponse:] AVContentKeySession's keySystem is not same as that of keyResponse"

This issue does not occur on older devices (we support iOS 13, 14, 15).

I am unable to find much documentation about this error so any insight is appreciated:

Code Overview

  • Use ContentKeyRequest to request an application certificate
  • Use returned Cert to call makeStreamingContentKeyRequestData
  • Use returned data to request FairPlay license
  • Use returned CKC to generate AVContentKeyResponse (i.e. AVContentKeyResponse(fairPlayStreamingKeyResponseData)
  • Call processContentKeyResponse(_)
  • App crash/exception thrown when callling processContentKeyResponse

I am seeing other issues related to DRM and iOS 16 but none seem to match my particular problem. i.e. I am not dealing with downloaded content and offline DRM

asked Nov 22, 2022 at 18:17
4
  • Did you figure out what was causing this? Commented Feb 1, 2023 at 23:49
  • @hackerman - not yet. Commented Feb 6, 2023 at 14:32
  • I think this happens when the response is being called as ContentKeySession is being shutdown. Just a theory. Commented Mar 7, 2023 at 11:57
  • @Hackerman I've noticed it when tuning into an asset for the first time or sometimes when retuning it. Its often very intermittent Commented Mar 14, 2023 at 16:56

1 Answer 1

1

For me, this error is thrown when the content is dismissed before FairPlay has a chance to process the content key:

let keyResponse = AVContentKeyResponse(fairPlayStreamingKeyResponseData: ckcData)
// Error happens at this point if request is active
keyRequest.processContentKeyResponse(keyResponse)

Since I'm using Alamofire to make the certificate, SPC, and CKC calls, stopping all the requests immediately upon dismissing the content prevented the key processing:

Alamofire.Session.default.getAllTasks { tasks in
 tasks.forEach{ 0ドル.cancel() }
}

Of course this may not be an ideal approach, but let me know if anyone finds a better way.

answered May 3, 2023 at 8:43
Sign up to request clarification or add additional context in comments.

2 Comments

Thanks for the response. So your suggestion is to not call processContentKeyResponse if the content is being abandoned in some way? i.e. User dismisses view, etc.
@rmigneco That's right! That was at least the root of my problem

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.