3

Are there any changes in FairPlay logic? My app has FairPlay protected Videos and Audio, they work perfectly until iOS 15.7, but in iOS 16

makeStreamingContentKeyRequestData is throwing me following error :

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

What could be the possible reason for this and solution?

Thanks in Advance

4 Answers4

1

We are using AVContentKeySession for downloading, met with the same error, and fixed it. For our case, the issue was as following.

Issue observed:

  1. On iOS16.0.3, 12s later after "license request" was triggered firstly by app during downloading, "license request" would be triggered again by AVFoundation framework ("contentKeySession(_ session: AVContentKeySession, didProvide keyRequest: AVContentKeyRequest)" was called again), and then error “-19152“ wad reported quickly by framework. Error log: contentKeySession(_:contentKeyRequest:didFailWithError:), line: XXX, message: XXX, url: XXX, error is Domain=CoreMediaErrorDomain Code=-19152 "(null)"
  2. On iOS15.6.1, after "license request" was triggered by app during downloading, framework would not trigger any "license request" again.

Root cause: iOS Framework API(AVContentKeySession & AVPersistableContentKeyRequest) behaviors changed on iOS16.

Solution: Add “keyRequest.processContentKeyResponse(keyResponse)” after CKC has been downloaded on iOS16+.

  • On iOS11 - iOS15, we didn't call it after downloading, instead we only save persistentKeyData locally, and called processContentKeyResponse when playing. That always worked fine on these iOS versions.
  • But on iOS16 and above(until iOS16.1 Beta4 by now), the old process would trigger framework error. So we added this fix.
amy.sheng
  • 36
  • 5
0

Function streamingContentKeyRequestDataForApp is deprecated on iOS 15 according to documentation. Use function makeStreamingContentKeyRequestData that is specified in new function documentation. Here is an example usage:

func makeStreamingContentKeyRequestData(
    forApp appIdentifier: Data,
    contentIdentifier: Data?,
    options: [String : Any]? = nil,
    completionHandler handler: @escaping (Data?, Error?) -> Void
)
Mr.SwiftOak
  • 1,469
  • 3
  • 8
  • 19
0

The issue I had was that the keyRequest.options was not getting set as it showed up nil (in iOS 16 for whatever weird reason).

I'm passing the correct options to processContentKeyRequest(withIdentifer identifier: Any?, initializationData: Data?, options: [String : Any]? = nil).

But in the ContentKeyDelegate functions they are showing otherwise. So, my workaround is just using a global options dictionary for storing the license URL and asset data. You can use any storage method you prefer.

6rchid
  • 1,074
  • 14
  • 19
-2

I have solved the issue, the issue was with duplicate EXT tags in m3u8 files which somehow worked for iOS 15 since it picked information from the first tag whereas in iOS 16 it was using all the tags and causing a Error

  • Hi, I'm currently running into the same issue. Which specific HLS EXT tags were the root cause for you ? Thank you very much for your help ! – warchimede Sep 22 '22 at 14:05
  • Please provide more details in what the issue was. All tags in an m3u8 begin with #EXT so the explanation doesn't provide much information as to which ones in particular (and what about them) were causing issues. – theRealRobG Sep 26 '22 at 14:01