diff --git a/Classes/Base.lproj/AssistantViewScreens.xib b/Classes/Base.lproj/AssistantViewScreens.xib index 847755544..8426a4403 100644 --- a/Classes/Base.lproj/AssistantViewScreens.xib +++ b/Classes/Base.lproj/AssistantViewScreens.xib @@ -1,9 +1,9 @@ - + - + diff --git a/Classes/LinphoneAppDelegate.m b/Classes/LinphoneAppDelegate.m index 1d4c152c3..ef2219282 100644 --- a/Classes/LinphoneAppDelegate.m +++ b/Classes/LinphoneAppDelegate.m @@ -321,7 +321,7 @@ return NO; } - VIEW(ActiveCallOrConferenceView); // to get created and all observers added + [PhoneMainView.instance.mainViewController getCachedController:ActiveCallOrConferenceView.compositeViewDescription.name]; // This will create the single instance of the ActiveCallOrConferenceView including listeneres return YES; } diff --git a/Classes/LinphoneUI/UICompositeView.h b/Classes/LinphoneUI/UICompositeView.h index e91b21fdb..b7c4739cb 100644 --- a/Classes/LinphoneUI/UICompositeView.h +++ b/Classes/LinphoneUI/UICompositeView.h @@ -85,7 +85,6 @@ - (UIInterfaceOrientation)currentOrientation; - (void)clearCache:(NSArray *)exclude; - (IBAction)onRightSwipe:(id)sender; -- (void) removeCallViewFromCache; @end diff --git a/Classes/LinphoneUI/UICompositeView.m b/Classes/LinphoneUI/UICompositeView.m index 08baa4963..3df38c997 100644 --- a/Classes/LinphoneUI/UICompositeView.m +++ b/Classes/LinphoneUI/UICompositeView.m @@ -305,13 +305,6 @@ return nil; } --(void) removeCallViewFromCache { - for (NSString *key in [viewControllerCache allKeys]) { - if ([key isEqualToString:ActiveCallOrConferenceView.compositeViewDescription.name]) { - [viewControllerCache removeObjectForKey:key]; - } - } -} - (void)clearCache:(NSArray *)exclude { for (NSString *key in [viewControllerCache allKeys]) { diff --git a/Classes/Swift/Voip/ViewModels/ConferenceParticipantDeviceData.swift b/Classes/Swift/Voip/ViewModels/ConferenceParticipantDeviceData.swift index 1a0e066d5..4180a406e 100644 --- a/Classes/Swift/Voip/ViewModels/ConferenceParticipantDeviceData.swift +++ b/Classes/Swift/Voip/ViewModels/ConferenceParticipantDeviceData.swift @@ -28,7 +28,6 @@ class ConferenceParticipantDeviceData { let videoEnabled = MutableLiveData() let activeSpeaker = MutableLiveData() let isInConference = MutableLiveData() - private var videoView: UIView? = nil var core : Core { get { Core.get() } } @@ -39,17 +38,16 @@ class ConferenceParticipantDeviceData { self.participantDevice = participantDevice participantDeviceDelegate = ParticipantDeviceDelegateStub( onIsSpeakingChanged: { (participantDevice, isSpeaking) in - Log.i("[Conference Participant Device] Participant \(participantDevice ) isspeaking = \(isSpeaking)") + Log.i("[Conference Participant Device] Participant \(participantDevice.address?.asStringUriOnly()) isspeaking = \(isSpeaking)") self.activeSpeaker.value = isSpeaking }, onConferenceJoined: { (participantDevice) in - Log.i("[Conference Participant Device] Participant \(participantDevice) has joined the conference") + Log.i("[Conference Participant Device] Participant \(participantDevice.address?.asStringUriOnly()) has joined the conference") self.isInConference.value = true - self.setVideoView(view: self.videoView) }, onConferenceLeft: { (participantDevice) in - Log.i("[Conference Participant Device] Participant \(participantDevice) has left the conference") + Log.i("[Conference Participant Device] Participant \(participantDevice.address?.asStringUriOnly()) has left the conference") self.isInConference.value = false }, onStreamCapabilityChanged: { (participantDevice, direction, streamType) in - Log.i("[Conference Participant Device] Participant \(participantDevice) video stream direction changed: \(direction)") + Log.i("[Conference Participant Device] Participant \(participantDevice.address?.asStringUriOnly()) video stream direction changed: \(direction)") self.videoEnabled.value = direction == MediaDirection.SendOnly || direction == MediaDirection.SendRecv if (streamType == StreamType.Video) { Log.i("[Conference Participant Device] Participant [\(participantDevice.address?.asStringUriOnly())] video capability changed to \(direction)") @@ -58,9 +56,6 @@ class ConferenceParticipantDeviceData { if (streamType == StreamType.Video) { Log.i("[Conference Participant Device] Participant [\(participantDevice.address?.asStringUriOnly())] video availability changed to \(available)") self.videoEnabled.value = available - if (available) { - self.setVideoView(view: self.videoView) - } } } @@ -96,15 +91,14 @@ class ConferenceParticipantDeviceData { return isMe && Core.get().showSwitchCameraButton() } - func setVideoView(view:UIView?) { - self.videoView = view + func setVideoView(view:UIView) { Log.i("[Conference Participant Device] Setting textureView \(view) for participant \(participantDevice.address?.asStringUriOnly())") - view?.contentMode = .scaleAspectFill + view.contentMode = .scaleAspectFill if (isMe) { core.usePreviewWindow(yesno: false) core.nativePreviewWindow = view } else { - participantDevice.nativeVideoWindowId = view != nil ? UnsafeMutableRawPointer(Unmanaged.passUnretained(view!).toOpaque()) : nil + participantDevice.nativeVideoWindowId = UnsafeMutableRawPointer(Unmanaged.passRetained(view).toOpaque()) } } } diff --git a/Classes/Swift/Voip/Views/CompositeViewControllers/ActiveCallOrConferenceView.swift b/Classes/Swift/Voip/Views/CompositeViewControllers/ActiveCallOrConferenceView.swift index 152242a88..5cce8a48a 100644 --- a/Classes/Swift/Voip/Views/CompositeViewControllers/ActiveCallOrConferenceView.swift +++ b/Classes/Swift/Voip/Views/CompositeViewControllers/ActiveCallOrConferenceView.swift @@ -310,7 +310,6 @@ import linphonesw func updateNavigation() { if (Core.get().callsNb == 0) { PhoneMainView.instance().popView(self.compositeViewDescription()) - PhoneMainView.instance().mainViewController.removeCallFromCache() } else { if let data = CallsViewModel.shared.currentCallData.value { if (data?.isOutgoing.value == true || data?.isIncoming.value == true) { diff --git a/Classes/Swift/Voip/Views/Fragments/Conference/VoipConferenceGridView.swift b/Classes/Swift/Voip/Views/Fragments/Conference/VoipConferenceGridView.swift index f8d863e5f..37ccb0416 100644 --- a/Classes/Swift/Voip/Views/Fragments/Conference/VoipConferenceGridView.swift +++ b/Classes/Swift/Voip/Views/Fragments/Conference/VoipConferenceGridView.swift @@ -74,6 +74,7 @@ class VoipConferenceGridView: UIView, UICollectionViewDataSource, UICollectionVi let layout: UICollectionViewFlowLayout = UICollectionViewFlowLayout() layout.minimumInteritemSpacing = 0 layout.minimumLineSpacing = 0 + layout.estimatedItemSize = .zero grid = UICollectionView(frame:.zero, collectionViewLayout: layout) super.init(frame: .zero)