From b63779b65ec838addee91f9fdb84152eac3704ca Mon Sep 17 00:00:00 2001 From: Christophe Deschamps Date: Tue, 15 Nov 2022 07:29:16 +0100 Subject: [PATCH] Enable camera in background context when app goes in background --- Classes/LinphoneAppDelegate.m | 2 +- Classes/Swift/ProviderDelegate.swift | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Classes/LinphoneAppDelegate.m b/Classes/LinphoneAppDelegate.m index 604494483..62406a221 100644 --- a/Classes/LinphoneAppDelegate.m +++ b/Classes/LinphoneAppDelegate.m @@ -131,7 +131,7 @@ const LinphoneCallParams *params = linphone_call_get_current_params(call); if (linphone_call_params_video_enabled(params)) { - linphone_call_enable_camera(call, [CallManager.instance backgroundContextCameraIsEnabled] || (linphone_call_get_call_log(call) && linphone_call_log_was_conference(linphone_call_get_call_log(call)))); + linphone_call_enable_camera(call, [CallManager.instance backgroundContextCameraIsEnabled]); } [CallManager.instance setBackgroundContextCallWithCall:nil]; } else if (linphone_call_get_state(call) == LinphoneCallIncomingReceived) { diff --git a/Classes/Swift/ProviderDelegate.swift b/Classes/Swift/ProviderDelegate.swift index 0c4c8d7d7..22600fa45 100644 --- a/Classes/Swift/ProviderDelegate.swift +++ b/Classes/Swift/ProviderDelegate.swift @@ -192,8 +192,8 @@ extension ProviderDelegate: CXProviderDelegate { if (UIApplication.shared.applicationState != .active) { CallManager.instance().backgroundContextCall = call - CallManager.instance().backgroundContextCameraIsEnabled = call!.params?.videoEnabled ?? false - call?.cameraEnabled = false // Disable camera while app is not on foreground + CallManager.instance().backgroundContextCameraIsEnabled = call.params?.videoEnabled == true || call.callLog?.wasConference() == true + call.cameraEnabled = false // Disable camera while app is not on foreground } CallManager.instance().callkitAudioSessionActivated = false CallManager.instance().lc?.configureAudioSession()