I've implemented the AVContentKeySession APIs in my app.
This app downloads FairPlay protected streams, and plays them later.
In a particular session of the app:
- The user downloads a FairPlay stream
- The app calls contentKeySession.processContentKeyRequest(withIdentifier: skdURL, initializationData: nil, options: nil) to initiate the license acquisition process
- The relevant AVContentKeySessionDelegate methods are called and the license acquisition completes
- The user can play offline.
For testing purposes, we set the rental duration (on the KSM) to 5 minutes. After 5 minutes playback fails (as expected).
- The app tries to renew the license by calling contentKeySession.processContentKeyRequest(...) again
- The contentKeySession(_ session: AVContentKeySession, didProvide keyRequest: AVContentKeyRequest) delegate is not called.
The AVContentKeySession object is used as a singleton, as in the HLSCatalog app, so the renew is using the same session as the initial acquisition -- not sure if it's relevant.