In my app I can enable and disable airplay using the MPVolumeView method. How can I detect if the audio of my app is playing through the Apple TV or through the iPhone so I can change the color of the airplay button? To make the airplay actionSheet come up, right now I do this.
for (UIButton *button in volumeView.subviews)
{
if ([button isKindOfClass:[UIButton class]])
{
[button sendActionsForControlEvents:UIControlEventTouchUpInside];
}
}
I have no way of knowing if the user presses the Apple TV option or presses cancel on the actioonSheet. Is it possible to know where the audio is going through so I can accordingly change the button image?