Issue with Airplay for DRM videos

When I try to send a DRM-protected video via Airplay to an Apple TV, the license request is made twice instead of once as it normally does on iOS.

We only allow one request per session for security reasons, this causes the second request to fail and the video won't play. We've tested DRM-protected videos without token usage limits and it works, but this creates a security hole in our system.

Why does it request the license twice in function: func contentKeySession(_ session: AVContentKeySession, didProvide keyRequest: AVContentKeyRequest)?

Is there a way to prevent this?

 Can you clarify the sender side device and the content being AirPlayed? Was the content first played locally on the iOS device and then an AirPlay Video response being triggered. Ideally, the server side sees that the SPC is created for AirPlay and not count it towards the slot rules. Please file a feedback assistance report for the sender and receiver so we can understand the flow here.

Issue with Airplay for DRM videos
 
 
Q