Thanks for being a part of WWDC25!

How did we do? We’d love to know your thoughts on this year’s conference. Take the survey here

AVContentKeySession key renewal on Airplay

Our streaming app uses FairPlay-protected video streams, which previously worked fine when using AVAssetResourceLoaderDelegate to provide CKCs.

Recently, we migrated to AVContentKeySession, and while everything works as expected during regular playback, we encountered an issue with AirPlay.

Our CKC has a 120-second expiry, so we renew it by calling renewExpiringResponseData.. This trigger the didProvideRenewingContentKeyRequest delegate and we respond with updated CKC.

However, when streaming via AirPlay, both video and audio freeze exactly after 120 seconds.

To validate the issue, I tested with AVAssetResourceLoaderDelegate and found that I can reproduce the same freeze if I do not renew the key. This suggests that AirPlay is not accepting the renewed CKC when using AVContentKeySession.

Additional Details:

  • This issue occurs across different iOS versions and various AirPlay devices.
  • The same content plays without issues when played directly on the device.
  • The renewal process is successful, and segments continue to load, but playback remains frozen.
  • Tried renewing the CKC bit early (100s).
  • I also tried setting player.usesExternalPlaybackWhileExternalScreenIsActive = true, but the issue persists.
  • We don't use persistentKey.

Is there anything else that needs to be considered for proper key renewal when AirPlaying? Any help on how to fix this or confirmation if this is a known issue would be greatly appreciated.

Did you get a valid license after calling renewExpiringResponseData and give it to iOS? Some old iOS version will raise error when calling renewExpiringResponseData(), but latest version seems ok. And do you know how to use AVAssetResourceLoaderDelegate to renew the license?

Yes, I get a valid license after calling renewExpiringResponseData. I am testing this on the latest iOS 18.

In AVAssetResourceLoaderDelegate, we need to set

request.contentInformationRequest?.renewalDate = renewalData 

on AVAssetResourceLoadingRequest.

So both AVContentKeySession and AVAssetResourceLoaderDelegate don't work then, It's better raise a ticket to Apple. I had another issue that on iOS18 even the license expires but the video continues playing. May I ask if you have the similar issue? It happens in the device, not airplay. thanks.

No , I mentioned in the original post AVAssetResourceLoaderDelegate did work fine without any issue. its the renewal on AVContentKeySession while airplay is not working

AVContentKeySession key renewal on Airplay
 
 
Q