When pressing camera in audio only mode conference, enable video in SendReceive or ReceiveOnly mode in accordance with video activation policy of core

This commit is contained in:
Christophe Deschamps 2023-01-31 17:08:16 +01:00
parent 79cb76ac75
commit eca3dbe9d9
2 changed files with 2 additions and 4 deletions

View file

@ -254,9 +254,7 @@ class ConferenceViewModel {
if let conference = conference.value, let call = conference.call, let params = try?call.core?.createCallParams(call: call) {
params.videoEnabled = layout != .AudioOnly
params.conferenceVideoLayout = layout == ConferenceDisplayMode.Grid ? .Grid : .ActiveSpeaker
if (sendVideo) {
params.videoDirection = .SendRecv
}
params.videoDirection = sendVideo ? .SendRecv : .RecvOnly
try?call.update(params: params)
conferenceDisplayMode.value = layout

View file

@ -147,7 +147,7 @@ class ControlsViewModel {
if let currentCall = core.currentCall {
if (currentCall.conference != nil) {
if (ConferenceViewModel.shared.conferenceDisplayMode.value == .AudioOnly) {
ConferenceViewModel.shared.changeLayout(layout: .ActiveSpeaker, sendVideo:true)
ConferenceViewModel.shared.changeLayout(layout: .ActiveSpeaker, sendVideo:Core.get().videoActivationPolicy?.automaticallyInitiate == true)
} else if let params = try?core.createCallParams(call: currentCall) {
isVideoUpdateInProgress.value = true
params.videoDirection = params.videoDirection == MediaDirection.RecvOnly ? MediaDirection.SendRecv : MediaDirection.RecvOnly