From 90c367ccca8d6e6ad4d07143fdaa61049418f577 Mon Sep 17 00:00:00 2001 From: Christophe Deschamps Date: Fri, 22 Jul 2022 12:09:10 +0200 Subject: [PATCH] Workarounds for active speaker: do not display 'me' device name when speaking + showing ourselves when alone --- Classes/Swift/Voip/ViewModels/ConferenceViewModel.swift | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Classes/Swift/Voip/ViewModels/ConferenceViewModel.swift b/Classes/Swift/Voip/ViewModels/ConferenceViewModel.swift index 046cde8eb..22fd0eb53 100644 --- a/Classes/Swift/Voip/ViewModels/ConferenceViewModel.swift +++ b/Classes/Swift/Voip/ViewModels/ConferenceViewModel.swift @@ -127,7 +127,7 @@ class ConferenceViewModel { Log.i("[Conference] Participant [\(participantDevice.address!.asStringUriOnly())] is speaking = \(isSpeaking)") if (isSpeaking) { if let device = self.conferenceParticipantDevices.value?.filter ({ - $0.participantDevice.address!.weakEqual(address2: participantDevice.address!) + $0.participantDevice.address!.weakEqual(address2: participantDevice.address!) && !$0.isMe // TODO: FIXME: remove, this is a temporary workaround to not have your name displayed above someone else video in active speaker layout when you talk }).first { self.speakingParticipant.value = device } else { @@ -319,6 +319,10 @@ class ConferenceViewModel { conference.me?.devices.forEach { (device) in Log.i("[Conference] \(conference) Participant device for myself found: \(device.name) (\(device.address!.asStringUriOnly()))") let deviceData = ConferenceParticipantDeviceData(participantDevice: device, isMe: true) + if (devices.count == 0) { + // TODO: FIXME: Temporary workaround when alone in a conference in active speaker layout + speakingParticipant.value = deviceData + } devices.append(deviceData) }