The exact answer to my question is:
(i) It is not possible to switch audio resources programmatically using the open API, except switching to the built-in speakers.
[[AVAudioSession sharedInstance] overrideOutputAudioPort:AVAudioSessionPortOverrideSpeaker error:nil];
(ii) Airplay-, AudioRoute. AirPlay AVPlayer
, :
MPVolumeView, volumeSlider routeButton. airplayDevice Apple (airPlay, bluetooth ..) UIActionSheet, , routeButton, , audioRouteChangeNotification:
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(audioRouteHasChangedNotification:) name:AVAudioSessionRouteChangeNotification object:[AVAudioSession sharedInstance]];
( , / , )
, API:
MPMediaPlayer framework MPAVRoutingController, :
Class MPAVRoutingController = NSClassFromString(@"MPAVRoutingController");
Class MPAVRoute = NSClassFromString(@"MPAVRoute");
id routingController = [[MPAVRoutingController alloc] init];
NSArray* availableRoutes = [routingController performSelector:@selector(availableRoutes)];
BOOL isSwitchSuccesful = [[routingController performSelector:@selector(pickRoute:) withObject:availableRoutes.lastObject] boolValue];
( audioRoute , Airplay: airplayRoute)