Streaming AVPlayer radio transmitter without listening through bluetooth speaker

I am using AVPlayer

for my radio streaming application. But my problem is that my clients are complaining about not being able to listen when they are using a bluetooth speaker. Is there any special permission I need to grant in the application. Please let me know what the problem might be. Thanks to

This is how I handled Audiosession

audioPlayer=[Player sharedManager];
NSError *sessionError = nil;
[[AVAudioSession sharedInstance] setActive:true error:&sessionError];
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayAndRecord error:&sessionError];
/* Pick any one of them */
// 1. Overriding the output audio route
// UInt32 audioRouteOverride = kAudioSessionOverrideAudioRoute_Speaker;
//AudioSessionSetProperty(kAudioSessionProperty_OverrideAudioRoute, sizeof(audioRouteOverride), &audioRouteOverride);
@try {
    [[AVAudioSession sharedInstance] overrideOutputAudioPort:AVAudioSessionPortOverrideSpeaker error:&sessionError];
} @catch (NSException *exception) {
    NSLog(@"-----EXCEPTION-----%@",exception);
} @finally {

}

// 2. Changing the default output audio route
// UInt32 doChangeDefaultRoute = 1;
//AudioSessionSetProperty(kAudioSessionProperty_OverrideCategoryDefaultToSpeaker, sizeof(doChangeDefaultRoute), &doChangeDefaultRoute);

      

+3
ios objective-c avplayer


source to share


No one has answered this question yet

Check out similar questions:

fourteen
AVPlayer Video Blank but hears sound
nine
Play audio through the top (phone call) speaker
6
iOS: Using Bluetooth audio output (kAudioSessionProperty_OverrideCategoryEnableBluetoothInput) AudioSession
4
Swift Radio Streaming AVPlayer
3
Low microphone recording issue when using AVAudioSession for AVAudioSessionModeVideoChat
3
iOS 7 Get all available audio devices (bluetooth, headset, speaker, phone)
1
Bluetooth headset causing routing issues on iOS
1
background mode in ios with sound being killed by other apps
0
AVPlayer does not play streaming radio with dynamic url
0
Intercom with Bluetooth headset



All Articles
Loading...
X
Show
Funny
Dev
Pics