How to get AirPlay working with AWS cloudFront encrypted video(audio) URL

I'm using cloudFront lambda to encrypt urls and AVURLAssetHTTPHeaderFieldsKey through md5 token to decrypt it with AVPlayer.
The problem is that AVPlayer is working fine but when trying to cast the video with AirPlay, it flashs for a second then nothing is casted.
Thanks,
I'm having the same exact issue in the same scenario. Did you find how to handle it?

There are two areas I would explore here:

  1. Is the URL provided by your lambda function single use only? i.e. could it be that the AirPlay target is not able to access that URL because it has already been 'used' on the host device?
  2. Have you inspected the data passed to the AirPlay target to determine whether it is sending the encrypted or decrypted URL? i.e. is it possible that the AirPlay target is receiving the encrypted URL and is not sure how to handle it?
How to get AirPlay working with AWS cloudFront encrypted video(audio) URL
 
 
Q