From cf9cfe7b35a7316f1dca8840adf271ae001e3cf5 Mon Sep 17 00:00:00 2001 From: Christophe Deschamps Date: Tue, 10 May 2022 10:07:23 +0200 Subject: [PATCH] Various update on video conference --- Classes/LinphoneManager.m | 7 +++++++ Classes/Swift/CallManager.swift | 1 + .../Swift/Extensions/IOS/UIVIewExtensions.swift | 8 ++++++++ .../VoipActiveSpeakerParticipantCell.swift | 16 ++++++++++++++++ .../Conference/VoipGridParticipantCell.swift | 2 +- Resources/assistant_external_sip.rc | 1 + Resources/assistant_linphone_create.rc | 2 ++ Resources/assistant_linphone_existing.rc | 2 ++ Resources/linphonerc | 1 + Resources/linphonerc-factory | 1 + 10 files changed, 40 insertions(+), 1 deletion(-) diff --git a/Classes/LinphoneManager.m b/Classes/LinphoneManager.m index a6821ad70..f0032fdfe 100644 --- a/Classes/LinphoneManager.m +++ b/Classes/LinphoneManager.m @@ -495,6 +495,11 @@ static int check_should_migrate_images(void *data, int argc, char **argv, char * linphone_account_set_params(account, newAccountParams); } } + + if (strcmp(appDomain.UTF8String, linphone_account_params_get_domain(newAccountParams)) == 0 && !linphone_account_params_rtp_bundle_enabled(newAccountParams)) { + linphone_account_params_enable_rtp_bundle(newAccountParams, true); + linphone_account_set_params(account,newAccountParams); + } linphone_account_params_unref(newAccountParams); accounts = accounts->next; @@ -1197,6 +1202,8 @@ static void linphone_iphone_is_composing_received(LinphoneCore *lc, LinphoneChat [NSNotificationCenter.defaultCenter postNotificationName:kLinphoneCoreUpdate object:LinphoneManager.instance userInfo:dict]; + + } static BOOL libStarted = FALSE; diff --git a/Classes/Swift/CallManager.swift b/Classes/Swift/CallManager.swift index a99fb228b..444fc8617 100644 --- a/Classes/Swift/CallManager.swift +++ b/Classes/Swift/CallManager.swift @@ -275,6 +275,7 @@ import AVFoundation if (isConference) { lcallParams.videoEnabled = true lcallParams.videoDirection = ConferenceWaitingRoomViewModel.sharedModel.isVideoEnabled.value == true ? .SendRecv : .RecvOnly + lcallParams.conferenceVideoLayout = ConferenceWaitingRoomViewModel.sharedModel.joinLayout.value! } else { lcallParams.videoEnabled = isVideo } diff --git a/Classes/Swift/Extensions/IOS/UIVIewExtensions.swift b/Classes/Swift/Extensions/IOS/UIVIewExtensions.swift index 03ccbff0a..edbb118be 100644 --- a/Classes/Swift/Extensions/IOS/UIVIewExtensions.swift +++ b/Classes/Swift/Extensions/IOS/UIVIewExtensions.swift @@ -39,6 +39,14 @@ extension UIView { return self } + + func makeHeightMatchWidth() -> UIView { + snp.makeConstraints { (make) in + make.height.equalTo(snp.width) + } + return self + } + func size(w:CGFloat,h:CGFloat) -> UIView { snp.makeConstraints { (make) in make.width.equalTo(w) diff --git a/Classes/Swift/Voip/Views/Fragments/Conference/VoipActiveSpeakerParticipantCell.swift b/Classes/Swift/Voip/Views/Fragments/Conference/VoipActiveSpeakerParticipantCell.swift index 02c2f384f..4e74b6b5b 100644 --- a/Classes/Swift/Voip/Views/Fragments/Conference/VoipActiveSpeakerParticipantCell.swift +++ b/Classes/Swift/Voip/Views/Fragments/Conference/VoipActiveSpeakerParticipantCell.swift @@ -42,17 +42,23 @@ class VoipActiveSpeakerParticipantCell: UICollectionViewCell { var participantData: ConferenceParticipantDeviceData? = nil { didSet { if let data = participantData { + data.isInConference.clearObservers() data.isInConference.readCurrentAndObserve { (isIn) in self.updateBackground() self.pause.isHidden = isIn == true self.pauseLabel.isHidden = self.pause.isHidden + self.videoView.isHidden = data.videoEnabled.value != true + self.switchCamera.isHidden = data.videoEnabled.value != true || !data.isSwitchCameraAvailable() } + data.videoEnabled.clearObservers() data.videoEnabled.readCurrentAndObserve { (videoEnabled) in self.updateBackground() if (videoEnabled == true) { + self.videoView.isHidden = false data.setVideoView(view: self.videoView) self.avatar.isHidden = true } else { + self.videoView.isHidden = true self.avatar.isHidden = false } self.switchCamera.isHidden = videoEnabled != true || !data.isSwitchCameraAvailable() @@ -63,6 +69,14 @@ class VoipActiveSpeakerParticipantCell: UICollectionViewCell { self.displayName.text = displayName } } + data.activeSpeaker.clearObservers() + data.activeSpeaker.readCurrentAndObserve { (active) in + if (active == true) { + self.layer.borderWidth = 2 + } else { + self.layer.borderWidth = 0 + } + } } } } @@ -85,6 +99,7 @@ class VoipActiveSpeakerParticipantCell: UICollectionViewCell { super.init(frame:.zero) layer.cornerRadius = corner_radius clipsToBounds = true + layer.borderColor = VoipTheme.primary_color.cgColor contentView.addSubview(videoView) videoView.matchParentDimmensions().done() @@ -113,6 +128,7 @@ class VoipActiveSpeakerParticipantCell: UICollectionViewCell { pauseLabel.toRightOf(displayName).alignParentBottom(withMargin:ActiveCallView.bottom_displayname_margin_bottom).done() contentView.matchParentDimmensions().done() + makeHeightMatchWidth().done() } required init?(coder: NSCoder) { diff --git a/Classes/Swift/Voip/Views/Fragments/Conference/VoipGridParticipantCell.swift b/Classes/Swift/Voip/Views/Fragments/Conference/VoipGridParticipantCell.swift index fe26dfdfe..82aa1e10f 100644 --- a/Classes/Swift/Voip/Views/Fragments/Conference/VoipGridParticipantCell.swift +++ b/Classes/Swift/Voip/Views/Fragments/Conference/VoipGridParticipantCell.swift @@ -84,7 +84,7 @@ class VoipGridParticipantCell: UICollectionViewCell { } } } - + func updateBackground() { if let data = participantData { if (data.isInConference.value != true) { diff --git a/Resources/assistant_external_sip.rc b/Resources/assistant_external_sip.rc index dd3090139..91365e833 100644 --- a/Resources/assistant_external_sip.rc +++ b/Resources/assistant_external_sip.rc @@ -11,6 +11,7 @@ 1 + 0 diff --git a/Resources/assistant_linphone_create.rc b/Resources/assistant_linphone_create.rc index 434a19a72..6b8ddec91 100644 --- a/Resources/assistant_linphone_create.rc +++ b/Resources/assistant_linphone_create.rc @@ -16,7 +16,9 @@ nat_policy_default_values 1 1 + 1 sip:conference-factory@sip.linphone.org + sip:videoconference-factory2@sip.linphone.org
diff --git a/Resources/assistant_linphone_existing.rc b/Resources/assistant_linphone_existing.rc index 8d4eb8f78..2a8539b08 100644 --- a/Resources/assistant_linphone_existing.rc +++ b/Resources/assistant_linphone_existing.rc @@ -16,7 +16,9 @@ nat_policy_default_values 1 1 + 1 sip:conference-factory@sip.linphone.org + sip:videoconference-factory2@sip.linphone.org
diff --git a/Resources/linphonerc b/Resources/linphonerc index 59e9aeda6..89d9ad73f 100644 --- a/Resources/linphonerc +++ b/Resources/linphonerc @@ -52,6 +52,7 @@ reg_expires=1314000 file_transfer_server_url=https://www.linphone.org:444/lft.php real_early_media=1 prefer_basic_chat_room=-1 +conference_layout=1 [net] edge_bw=10 diff --git a/Resources/linphonerc-factory b/Resources/linphonerc-factory index 94f461b92..999887c72 100644 --- a/Resources/linphonerc-factory +++ b/Resources/linphonerc-factory @@ -36,6 +36,7 @@ linphone_specs=groupchat,lime version_check_url_root=https://download.linphone.org/releases prefer_basic_chat_room=-1 + [sound] eq_location=mic