ui: do not enable speaker in calls when contact turned on video (#4998)

This commit is contained in:
Stanislav Dmitrenko
2024-10-08 15:57:33 +01:00
committed by GitHub
parent 6907f02ea6
commit 35fc0544a0
2 changed files with 6 additions and 5 deletions
@@ -226,8 +226,9 @@ actual fun ActiveCallView() {
ActiveCallOverlay(call, chatModel, callAudioDeviceManager)
}
}
KeyChangeEffect(call?.hasVideo) {
if (call != null) {
KeyChangeEffect(call?.localMediaSources?.hasVideo) {
if (call != null && call.hasVideo && callAudioDeviceManager.currentDevice.value?.type == AudioDeviceInfo.TYPE_BUILTIN_EARPIECE) {
// enabling speaker on user action (peer action ignored) and not disabling it again
callAudioDeviceManager.selectLastExternalDeviceOrDefault(call.hasVideo, true)
}
}