diff --git a/Classes/Swift/Voip/ViewModels/ConferenceParticipantDeviceData.swift b/Classes/Swift/Voip/ViewModels/ConferenceParticipantDeviceData.swift index d0d3a02d6..0affb76b7 100644 --- a/Classes/Swift/Voip/ViewModels/ConferenceParticipantDeviceData.swift +++ b/Classes/Swift/Voip/ViewModels/ConferenceParticipantDeviceData.swift @@ -97,7 +97,7 @@ class ConferenceParticipantDeviceData { core.usePreviewWindow(yesno: false) core.nativePreviewWindow = view } else { - participantDevice.nativeVideoWindowId = UnsafeMutableRawPointer(Unmanaged.passRetained(view).toOpaque()) + participantDevice.nativeVideoWindowId = UnsafeMutableRawPointer(Unmanaged.passUnretained(view).toOpaque()) } } } diff --git a/Classes/Swift/Voip/Views/Fragments/Conference/VoipConferenceActiveSpeakerView.swift b/Classes/Swift/Voip/Views/Fragments/Conference/VoipConferenceActiveSpeakerView.swift index f9d6b6756..09d1d4c9b 100644 --- a/Classes/Swift/Voip/Views/Fragments/Conference/VoipConferenceActiveSpeakerView.swift +++ b/Classes/Swift/Voip/Views/Fragments/Conference/VoipConferenceActiveSpeakerView.swift @@ -90,9 +90,6 @@ class VoipConferenceActiveSpeakerView: UIView, UICollectionViewDataSource, UICol } func reloadData() { - if (self.isHidden || conferenceViewModel?.conference.value?.call?.params?.conferenceVideoLayout != .ActiveSpeaker) { - return - } self.grid.reloadData() } @@ -212,6 +209,9 @@ class VoipConferenceActiveSpeakerView: UIView, UICollectionViewDataSource, UICol self.addSubview(fullScreenMutableView) fullScreenMutableView.matchParentSideBorders().alignUnder(view:headerView,withMargin: ActiveCallView.center_view_margin_top).alignParentBottom().done() } + DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) { + self.reloadData() + } } } @@ -219,6 +219,12 @@ class VoipConferenceActiveSpeakerView: UIView, UICollectionViewDataSource, UICol // UICollectionView related delegates + func collectionView(_ collectionView: UICollectionView, didEndDisplaying cell: UICollectionViewCell, forItemAt indexPath: IndexPath) { + let gcell = (cell as! VoipActiveSpeakerParticipantCell) + gcell.participantData?.participantDevice.nativeVideoWindowId = nil + gcell.participantData?.clearObservers() + } + func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumInteritemSpacingForSectionAt section: Int) -> CGFloat { return inter_cell } @@ -230,6 +236,9 @@ class VoipConferenceActiveSpeakerView: UIView, UICollectionViewDataSource, UICol } func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { + if (self.isHidden || conferenceViewModel?.conference.value?.call?.params?.conferenceVideoLayout != .ActiveSpeaker) { + return 0 + } guard let participantsCount = conferenceViewModel?.conferenceParticipantDevices.value?.count else { return .zero } diff --git a/Classes/Swift/Voip/Views/Fragments/Conference/VoipConferenceGridView.swift b/Classes/Swift/Voip/Views/Fragments/Conference/VoipConferenceGridView.swift index ac0773418..b4c93bfee 100644 --- a/Classes/Swift/Voip/Views/Fragments/Conference/VoipConferenceGridView.swift +++ b/Classes/Swift/Voip/Views/Fragments/Conference/VoipConferenceGridView.swift @@ -175,6 +175,7 @@ class VoipConferenceGridView: UIView, UICollectionViewDataSource, UICollectionVi func reloadData() { if (self.isHidden || conferenceViewModel?.conference.value?.call?.params?.conferenceVideoLayout != .Grid) { + self.grid.reloadData() return } computeCellSize() @@ -205,6 +206,9 @@ class VoipConferenceGridView: UIView, UICollectionViewDataSource, UICollectionVi } func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { + if (self.isHidden || conferenceViewModel?.conference.value?.call?.params?.conferenceVideoLayout != .Grid) { + return 0 + } guard let participantsCount = conferenceViewModel?.conferenceParticipantDevices.value?.count else { return .zero }