After searching in other frames to get the name of the Apple TV you are connected to, I finally found this information in the AudioToolbox structure. There may be other ways to get this, but so far I have not found another way. Hope this helps.
You will need to import the AudioToolbox framework:
#import <AudioToolbox/AudioToolbox.h>
and then the call method when you want to determine if the broadcast is available
- (BOOL)isAirplayActive { CFDictionaryRef currentRouteDescriptionDictionary = nil; UInt32 dataSize = sizeof(currentRouteDescriptionDictionary); AudioSessionGetProperty(kAudioSessionProperty_AudioRouteDescription, &dataSize, ¤tRouteDescriptionDictionary); self.deviceOutputType = nil; self.airplayDeviceName = nil; if (currentRouteDescriptionDictionary) { CFArrayRef outputs = CFDictionaryGetValue(currentRouteDescriptionDictionary, kAudioSession_AudioRouteKey_Outputs); if(CFArrayGetCount(outputs) > 0) { CFDictionaryRef currentOutput = CFArrayGetValueAtIndex(outputs, 0);
wovencharlie
source share