Fairplay stops working on iOS 12.4 and 13

705 views Asked by At

I have code to play encrypted Fairplay streams from my app and it works fine prior iOS 12.4. I use AVAssetResourceLoaderDelegate to get AVAssetResourceLoadingRequest from resourceLoader:shouldWaitForLoadingOfRequestedResource: and then extract SPC from the request and make http request to get CKC.

But on new iOS 12.4 a loading request is been cancelling and resourceLoader:didCancelLoadingRequest: is called right after resourceLoader:shouldWaitForLoadingOfRequestedResource: and my player stays in loading state with no errors. The same behaviour on beta iOS 13. Clear streams are playable and the problem with encrypted streams only.

Has anybody faced with this problem? Should I migrate to AVContentKeySession to load keys?

1

There are 1 answers

0
iUrii On BEST ANSWER

Finally I've found a root cause of my problem. My old code has next line:

resourceLoader.preloadsEligibleContentKeys = YES;

and it worked OK before.

But from 12.4 it breaks playing encrypted streams from my tests. Without setting this flag all works fine: playing online/offline content and downloading so it's weird but this flag is out-of-use on new iOS versions.