From 3043fc5c7a4de88bc8346fce4ec420ef69374892 Mon Sep 17 00:00:00 2001 From: Christophe Deschamps Date: Fri, 18 Nov 2022 09:27:26 +0100 Subject: [PATCH] Do not force speaker on video activation/deactivation in conference --- Classes/Swift/CallManager.swift | 2 +- Classes/Swift/Voip/ViewModels/ControlsViewModel.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Classes/Swift/CallManager.swift b/Classes/Swift/CallManager.swift index b1a38a957..8d94b317e 100644 --- a/Classes/Swift/CallManager.swift +++ b/Classes/Swift/CallManager.swift @@ -715,7 +715,7 @@ import AVFoundation let readyForRoutechange = CallManager.instance().callkitAudioSessionActivated == nil || (CallManager.instance().callkitAudioSessionActivated == true) if (readyForRoutechange && (cstate == .IncomingReceived || cstate == .OutgoingInit || cstate == .Connected || cstate == .StreamsRunning)) { - if ((call.currentParams?.videoEnabled ?? false) && CallManager.instance().isReceiverEnabled()) { + if ((call.currentParams?.videoEnabled ?? false) && CallManager.instance().isReceiverEnabled() && call.conference == nil) { CallManager.instance().changeRouteToSpeaker() } else if (isBluetoothAvailable()) { // Use bluetooth device by default if one is available diff --git a/Classes/Swift/Voip/ViewModels/ControlsViewModel.swift b/Classes/Swift/Voip/ViewModels/ControlsViewModel.swift index bc3189c62..1b758fafe 100644 --- a/Classes/Swift/Voip/ViewModels/ControlsViewModel.swift +++ b/Classes/Swift/Voip/ViewModels/ControlsViewModel.swift @@ -110,7 +110,7 @@ class ControlsViewModel { } } - if (ConfigManager.instance().lpConfigBoolForKey(key: "route_audio_to_speaker_when_video_enabled",defaultValue:true) && call.currentParams?.videoEnabled == true) { + if (ConfigManager.instance().lpConfigBoolForKey(key: "route_audio_to_speaker_when_video_enabled",defaultValue:true) && call.currentParams?.videoEnabled == true && call.conference == nil) { // Do not turn speaker on when video is enabled if headset or bluetooth is used if (!AudioRouteUtils.isHeadsetAudioRouteAvailable() && !AudioRouteUtils.isBluetoothAudioRouteCurrentlyUsed(call: call)