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

This commit is contained in:
Stanislav Dmitrenko authored and GitHub committed 2024-10-08 15:57:33 +01:00
1 parent 6907f02ea6
commit 35fc0544a0
2 files changed
+6 -5

No files matched your search

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