From d4e5c1fed84ff9fd7bed478b972ae7b7f04bdef0 Mon Sep 17 00:00:00 2001 From: Christophe Deschamps Date: Mon, 3 Oct 2022 14:56:21 +0200 Subject: [PATCH] Handle video/no video updates from Active Speaker --- Classes/Swift/Voip/ViewModels/ControlsViewModel.swift | 1 + .../Conference/VoipConferenceActiveSpeakerView.swift | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Classes/Swift/Voip/ViewModels/ControlsViewModel.swift b/Classes/Swift/Voip/ViewModels/ControlsViewModel.swift index 3e2f66807..bf9d01cc7 100644 --- a/Classes/Swift/Voip/ViewModels/ControlsViewModel.swift +++ b/Classes/Swift/Voip/ViewModels/ControlsViewModel.swift @@ -142,6 +142,7 @@ class ControlsViewModel { if let currentCall = core.currentCall { if (currentCall.conference != nil) { if let params = try?core.createCallParams(call: currentCall) { + isVideoUpdateInProgress.value = true params.videoDirection = params.videoDirection == MediaDirection.RecvOnly ? MediaDirection.SendRecv : MediaDirection.RecvOnly try?currentCall.update(params: params) } diff --git a/Classes/Swift/Voip/Views/Fragments/Conference/VoipConferenceActiveSpeakerView.swift b/Classes/Swift/Voip/Views/Fragments/Conference/VoipConferenceActiveSpeakerView.swift index 5b5ebccf0..908d88ef8 100644 --- a/Classes/Swift/Voip/Views/Fragments/Conference/VoipConferenceActiveSpeakerView.swift +++ b/Classes/Swift/Voip/Views/Fragments/Conference/VoipConferenceActiveSpeakerView.swift @@ -125,8 +125,10 @@ class VoipConferenceActiveSpeakerView: UIView, UICollectionViewDataSource, UICol } model.speakingParticipant.readCurrentAndObserve { speakingParticipant in if (model.activeSpeakerConferenceParticipantDevices.value!.count > 1) { - self.fillActiveSpeakerSpace(data: speakingParticipant,video: speakingParticipant?.videoEnabled.value == true) - self.muted.isHidden = true + speakingParticipant?.videoEnabled.readCurrentAndObserve { video in + self.fillActiveSpeakerSpace(data: speakingParticipant,video: video == true) + self.muted.isHidden = true + } } } }