diff --git a/ios/RCTTWVideoModule.m b/ios/RCTTWVideoModule.m index 23f0ad61..2b28bb3a 100644 --- a/ios/RCTTWVideoModule.m +++ b/ios/RCTTWVideoModule.m @@ -291,13 +291,15 @@ - (bool)_setLocalVideoEnabled:(bool)enabled cameraType:(NSString *)cameraType { NSError *error = nil; kTVIDefaultAVAudioSessionConfigurationBlock(); AVAudioSession *session = [AVAudioSession sharedInstance]; - AVAudioSessionMode mode = speaker ? AVAudioSessionModeVideoChat : AVAudioSessionModeVoiceChat ; + AVAudioSessionMode mode = speaker ? AVAudioSessionModeVideoChat : AVAudioSessionModeVoiceChat; // Overwrite the audio route if (![session setMode:mode error:&error]) { NSLog(@"AVAudiosession setMode %@",error); } - if (![session overrideOutputAudioPort:AVAudioSessionPortOverrideNone error:&error]) { + AVAudioSessionPortOverride portOverride = speaker: AVAudioSessionPortOverrideSpeaker : AVAudioSessionPortOverrideNone; + + if (![session overrideOutputAudioPort:portOverride error:&error]) { NSLog(@"AVAudiosession overrideOutputAudioPort %@",error); } } @@ -417,7 +419,7 @@ -(NSMutableDictionary*)convertLocalVideoTrackStats:(TVILocalVideoTrackStats *)st if (self.localDataTrack) { builder.dataTracks = @[self.localDataTrack]; } - + builder.dominantSpeakerEnabled = dominantSpeakerEnabled ? YES : NO; builder.roomName = roomName;