I would like to play an encrypted stream (available as an in-app purchase) via AirPlay. Here's a sample .m3u8 playlist:
#EXTM3U
#EXT-X-TARGETDURATION:10
#EXT-X-MEDIA-SEQUENCE:6849
#EXT-X-KEY:METHOD=AES-128,URI="http://auth.foo.ca/index.php?cmd=GetKey&key=bar.key"
#EXTINF:10,
http://media.foo.ca/1.ts
...
When the user makes an in-app purchase, a cookie with the user ID is created on the device. When the user tries to access the stream, index.php examines the cookie and checks the user ID on the backend. If the user has paid for the stream, it is decrypted and played on the device.
The stream works fine on the device, but gives an error on the Apple TV.
When encryption is turned off, the stream plays on the Apple TV as well.
I have read this Apple doc, but have not found it helpful.