Enable camera in background context when app goes in background

This commit is contained in:
Christophe Deschamps 2022-11-15 07:29:16 +01:00
parent 0fc1f024d3
commit b63779b65e
2 changed files with 3 additions and 3 deletions

View file

@ -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) {

View file

@ -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()