AVPlayer radio streaming not hearing through bluetooth speaker

Viewed 120

I am using AVPlayerfor my radio streaming app. But my problem is my clients are complaining they can't listen when they are using bluetooth speaker. Is there any special permission do I need to give within the app. Please let me know what might be the issue. Thanks

This is how I have 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);
0 Answers
Related