AVContentKeySession delegate not called on license expiration

Hi,


I'm working on offline Fairplay support. I hv taken reference from HLSCatalog sample app. In the happy flow everything is working. App is able to download the license and its playing in the offline. To test the license expiration we reduced the licenseDuration [rentalDuration] to 15 min. As expected playback failed with error code 11800.

Now its not giving callback that license has expired. And I checked the access log and error logs / there is no inofrmation about the license expiry.

Below method is not called on attaching keyRequest.processContentKeyResponse(keyResponse) expired license.


func contentKeySession(_ session: AVContentKeySession, shouldRetry keyRequest: AVContentKeyRequest,

reason retryReason: AVContentKeyRequestRetryReason) -> Bool {



Can someone help me here on how to detect the license expiration when playback fails / or even before playback starts. I need to show proper message to the user saying "contet has expired, plz renew it".

Replies

Hi,


I'm having the same issue too. We are therefore using an out-of-band fetch for the license expiration date to work around this issue. I would prefer if the delegate methods got called as expected but the FairPlay APIs aren't so easy to work with.


/Mattias

I am experiencing the same issue. I added the offlineKey TLLV block to CKC and as expected license expires as specified in the lease and rental time. However, when it expires iOS 12.1.1 does not report anything. Contrary, when trying to use the persisted license after it has expired with processContentKeyRequest iOS reports that the content key request has succeed through contentKeySession(contentKeySession:contentKeyRequestDidSucceed) callback from AVContentKeySessionDelegate. However, it does not succeed, since soon after AVPlayerItem fails to play the stream with error "The operation could not be completed". AVContentKeySessionDelegate is giving incorrect, or even worse, misleading information.