Enable full screen joining video conference with video

This commit is contained in:
Christophe Deschamps 2022-11-22 23:41:48 +01:00
parent eff9964b12
commit 9ab5a0f106

View file

@ -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")
}
}
}
}
}