I am using a loopback server that runs locally on iOS client to implement HLS streaming with custom AVAssetResourceLoader. I am able to stream segments via local host on the device. Airplay also works fine if I use an external IP instead of local host to stream the segments. However, when I use local host, I need to detect the viewer transition from iOS client to Airplay receiver and send the CDN url to the airplay receiver (instead of local host url) so that it can play the content. I could not find any documentation on how to detect the transition from iOS client to Airplay receiver. The property externalPlaybackActive only seems to detect once the airplay receiver is playing the content and not for the transition. Is there any way to detect when Airplay is enabled?
I haven't seen this thread before. I will try this and update with my findings. Thank you for your help.