mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-17 11:08:06 +00:00
Switch from audio only to active speaker using toggle video button (instead of disabling it)
This commit is contained in:
parent
669851065a
commit
65573ba1be
2 changed files with 8 additions and 4 deletions
|
|
@ -243,11 +243,14 @@ class ConferenceViewModel {
|
|||
}
|
||||
|
||||
|
||||
func changeLayout(layout: ConferenceDisplayMode) {
|
||||
func changeLayout(layout: ConferenceDisplayMode, sendVideo:Bool = false) {
|
||||
Log.i("[Conference] Trying to change conference layout to $layout")
|
||||
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
|
||||
}
|
||||
try?call.update(params: params)
|
||||
|
||||
conferenceDisplayMode.value = layout
|
||||
|
|
|
|||
|
|
@ -141,7 +141,9 @@ class ControlsViewModel {
|
|||
func toggleVideo() {
|
||||
if let currentCall = core.currentCall {
|
||||
if (currentCall.conference != nil) {
|
||||
if let params = try?core.createCallParams(call: currentCall) {
|
||||
if (ConferenceViewModel.shared.conferenceDisplayMode.value == .AudioOnly) {
|
||||
ConferenceViewModel.shared.changeLayout(layout: .ActiveSpeaker, sendVideo:true)
|
||||
} else 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)
|
||||
|
|
@ -197,8 +199,7 @@ class ControlsViewModel {
|
|||
(core.videoCaptureEnabled || core.videoPreviewEnabled) &&
|
||||
currentCall?.state != .Paused &&
|
||||
currentCall?.state != .PausedByRemote &&
|
||||
((currentCall != nil && currentCall?.mediaInProgress() != true) || (core.conference?.isIn == true)) &&
|
||||
(ConferenceViewModel.shared.conferenceExists.value != true || ConferenceViewModel.shared.conferenceDisplayMode.value != .AudioOnly)
|
||||
((currentCall != nil && currentCall?.mediaInProgress() != true) || (core.conference?.isIn == true))
|
||||
}
|
||||
|
||||
private func updateVideoEnabled() {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue