From 9ab5a0f106498ddc7f28b715a15b19d11a080f47 Mon Sep 17 00:00:00 2001 From: Christophe Deschamps Date: Tue, 22 Nov 2022 23:41:48 +0100 Subject: [PATCH] Enable full screen joining video conference with video --- .../ConferenceCallView.swift | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/Classes/Swift/Voip/Views/CompositeViewControllers/ConferenceCallView.swift b/Classes/Swift/Voip/Views/CompositeViewControllers/ConferenceCallView.swift index 4b39128cb..73ec3c827 100644 --- a/Classes/Swift/Voip/Views/CompositeViewControllers/ConferenceCallView.swift +++ b/Classes/Swift/Voip/Views/CompositeViewControllers/ConferenceCallView.swift @@ -72,6 +72,7 @@ import linphonesw } else { self.conferenceJoinSpinner.removeFromSuperview() self.conferenceJoinSpinner.stopRotation() + self.switchToFullScreenIfPossible(conference: ConferenceViewModel.shared.conference.value) } } @@ -90,6 +91,9 @@ import linphonesw ConferenceViewModel.shared.conferenceDisplayMode.readCurrentAndObserve { (conferenceMode) in if (ConferenceViewModel.shared.conferenceExists.value == true) { self.displaySelectedConferenceLayout() + if (conferenceMode != .AudioOnly) { + self.switchToFullScreenIfPossible(conference: ConferenceViewModel.shared.conference.value) + } } } ConferenceViewModel.shared.isConferenceLocallyPaused.readCurrentAndObserve { (paused) in @@ -155,5 +159,20 @@ import linphonesw self.conferenceActiveSpeakerView?.layoutRotatableElements() } + private func switchToFullScreenIfPossible(conference: Conference?) { + if (ConfigManager.instance().lpConfigBoolForKey(key: "enter_video_conference_enable_full_screen_mode", defaultValue: true)) { + if (conference?.currentParams?.isVideoEnabled == true) { + if (conference?.me?.devices.count == 0) { + Log.i("[Conference Call] Conference has video enabled but our device hasn't joined yet") + } else if (conference?.me?.devices.filter { $0.isInConference && $0.getStreamAvailability(streamType: StreamType.Video) }.first != nil) { + Log.i("[Conference Call] Conference has video enabled & our device has video enabled, enabling full screen mode") + ControlsViewModel.shared.fullScreenMode.value = true + } else { + Log.i("[Conference Call] Conference has video enabled but our device video is disabled") + } + } + } + } + }