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 after 120 sec. 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 no luck.
- 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.
TL;DR: Airplay video freezes when using AVContentKeySession
with key renewal