Custom FairPlay DRM error handling mechanics

Hi,

I have a usecase where I'd like to handle and prevent automatic retries whenever certain errors occur during FairPlay content key requests.

Here's the current flow:

  1. FairPlay certificate is requested and obtained from my server
  2. makeStreamingContentKeyRequestData is called on the keyRequest
  3. The license server will return a 403 along with a body response containing a json with the detailed code and message
  4. The error is caught and handled properly by calling AVContentKeyRequest.processContentKeyResponseError
  5. The AVContentKeySession automatically retries up to 8 times by providing a new key request through public func contentKeySession(_ session: AVContentKeySession, didProvide keyRequest: AVContentKeyRequest)
  6. My license server gets hit with 8 requests that will always result in a 403, these retries are useless
  7. My custom error is succesfully caught later down the line through AVPlayerItem.observe(\.status), this is great

Thing is.. I'd like to catch the 403 error and prevent any retry from being made at step 5, ideally through

public func contentKeySession(_ session: AVContentKeySession, contentKeyRequest keyRequest: AVContentKeyRequest, didFailWithError err: Error)

I've looked for quite a while and just can't seem to find any way of achieving this. Is this not supported at all?

Custom FairPlay DRM error handling mechanics
 
 
Q