Skip to content
This repository was archived by the owner on Mar 29, 2025. It is now read-only.

Commit e7355dc

Browse files
authored
Merge pull request #67 from voxeet/develop
CCS-5298 Release UXKit 1.7.4
2 parents 2e34297 + d199b34 commit e7355dc

File tree

7 files changed

+97
-37
lines changed

7 files changed

+97
-37
lines changed

VoxeetUXKit.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |spec|
22
spec.name = "VoxeetUXKit"
3-
spec.version = "1.7.3"
3+
spec.version = "1.7.4"
44
spec.summary = "The Voxeet UXKit is a quick way of adding premium audio, video chats, and other supported options."
55
spec.author = "Voxeet"
66
spec.homepage = "https://dolby.io"

VoxeetUXKit.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,7 @@
608608
"@executable_path/Frameworks",
609609
"@loader_path/Frameworks",
610610
);
611-
MARKETING_VERSION = 1.7.3;
611+
MARKETING_VERSION = 1.7.4;
612612
PRODUCT_BUNDLE_IDENTIFIER = com.voxeet.uxkit;
613613
PRODUCT_NAME = "$(TARGET_NAME)";
614614
PROVISIONING_PROFILE_SPECIFIER = "";
@@ -641,7 +641,7 @@
641641
"@executable_path/Frameworks",
642642
"@loader_path/Frameworks",
643643
);
644-
MARKETING_VERSION = 1.7.3;
644+
MARKETING_VERSION = 1.7.4;
645645
PRODUCT_BUNDLE_IDENTIFIER = com.voxeet.uxkit;
646646
PRODUCT_NAME = "$(TARGET_NAME)";
647647
PROVISIONING_PROFILE_SPECIFIER = "";

VoxeetUXKit/Code/Controllers/VTUXConferenceController.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,9 @@ extension VTUXConferenceController {
111111

112112
switch status {
113113
case .creating, .joining:
114-
// Properly remove the viewController from superview when joining if the previous conference status wasn't the one expected (`created`).
115-
if status == .joining && previousStatus != .created {
114+
// Properly remove the viewController from superview when joining
115+
// if the previous conference status wasn't one of the expected (`created`, `joined`).
116+
if status == .joining, ![VTConferenceStatus.created, .joined].contains(previousStatus) {
116117
// Remove conference view from superview.
117118
self.viewController?.view.removeFromSuperview()
118119
self.viewController = nil

VoxeetUXKit/Code/ViewControllers/ConferenceViewController+VTConferenceDelegate.swift

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -203,39 +203,27 @@ extension ConferenceViewController: VTConferenceDelegate {
203203

204204
private func screenShareStreamUpdated(participant: VTParticipant, stream: MediaStream) {
205205
if participant.id == VoxeetSDK.shared.session.participant?.id {
206+
localScreenSharePresenterId = participant.id
206207
// Enable screen share button when broadcast mode is enabled.
207208
let broadcast = VoxeetSDK.shared.appGroup != nil
208209
if broadcast {
209-
actionBarVC.screenShareButton(state: .on)
210+
updateScreenShareButton()
210211
}
211212
} else if !stream.videoTracks.isEmpty {
212-
// Stop active speaker and lock the current participant.
213-
startPresentation(participant: participant)
214-
215-
// Attach screen share stream.
216-
speakerVideoContentFill = speakerVideoVC.videoRenderer.contentFill
217-
speakerVideoVC.unattach()
218-
speakerVideoVC.attach(participant: participant, stream: stream)
219-
speakerVideoVC.contentFill(false, animated: false)
220-
speakerVideoVC.view.isHidden = false
213+
startReceivingScreenSharing(participant: participant)
221214
}
222215
}
223216

224217
private func screenShareStreamRemoved(participant: VTParticipant, stream: MediaStream) {
225218
if participant.id == VoxeetSDK.shared.session.participant?.id {
219+
localScreenSharePresenterId = nil
226220
// Disable screen share button when broadcast mode is enabled.
227221
let broadcast = VoxeetSDK.shared.appGroup != nil
228222
if broadcast {
229-
actionBarVC.screenShareButton(state: .off)
223+
updateScreenShareButton()
230224
}
231225
} else {
232-
// Unattach screen share stream.
233-
speakerVideoVC.unattach()
234-
speakerVideoVC.contentFill(speakerVideoContentFill, animated: false)
235-
speakerVideoVC.view.isHidden = true
236-
237-
// Reset active speaker and unlock previous participant.
238-
stopPresentation()
226+
stopReceivingScreenSharing(participant: participant)
239227
}
240228
}
241229

VoxeetUXKit/Code/ViewControllers/ConferenceViewController.swift

Lines changed: 59 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ class ConferenceViewController: OverlayViewController {
5050
var speakerVideoContentFill = false
5151
var isMinimized = false
5252
var audioPermissionInitiate = false
53+
var screenSharePresenterIds = [String]()
54+
var localScreenSharePresenterId: String?
5355

5456
// Conference timer.
5557
var conferenceStartTimer: Timer?
@@ -275,10 +277,6 @@ class ConferenceViewController: OverlayViewController {
275277
presenterID = participant?.id
276278
participantsVC.lock(participant: participant)
277279
activeSpeaker.end()
278-
279-
// Disable screen share button.
280-
actionBarVC.screenShareButton(state: .on)
281-
actionBarVC.screenShareButton.isEnabled(false, animated: true)
282280
}
283281

284282
func stopPresentation() {
@@ -287,10 +285,56 @@ class ConferenceViewController: OverlayViewController {
287285
participantsVC.lock(participant: nil)
288286
activeSpeaker.begin()
289287
activeSpeaker.refresh()
290-
291-
// Enable screen share button.
292-
actionBarVC.screenShareButton(state: .off)
293-
actionBarVC.screenShareButton.isEnabled(true, animated: true)
288+
}
289+
290+
func startReceivingScreenSharing(participant: VTParticipant) {
291+
if let presenterId = participant.id {
292+
screenSharePresenterIds.append(presenterId)
293+
}
294+
if screenSharePresenterIds.count == 1 {
295+
speakerVideoContentFill = speakerVideoVC.videoRenderer.contentFill
296+
speakerVideoVC.contentFill(false, animated: false)
297+
speakerVideoVC.view.isHidden = false
298+
299+
updateScreenShareButton()
300+
}
301+
participantsVC.select(participant: participant)
302+
updated(participant: participant)
303+
}
304+
305+
func stopReceivingScreenSharing(participant: VTParticipant) {
306+
screenSharePresenterIds.removeAll(where: { $0 == participant.id })
307+
308+
if let first = screenSharePresenterIds.first,
309+
let participant = VoxeetSDK.shared.conference.current?.participants.first(where: { $0.id == first })
310+
{
311+
participantsVC.select(participant: participant)
312+
updated(participant: participant)
313+
} else {
314+
speakerVideoVC.unattach()
315+
speakerVideoVC.contentFill(speakerVideoContentFill, animated: false)
316+
speakerVideoVC.view.isHidden = true
317+
participantsVC.lock(participant: nil)
318+
updated(participant: nil)
319+
320+
updateScreenShareButton()
321+
}
322+
}
323+
324+
func updateScreenShareButton() {
325+
if localScreenSharePresenterId != nil || !screenSharePresenterIds.isEmpty {
326+
actionBarVC.screenShareButton(state: .on)
327+
} else {
328+
actionBarVC.screenShareButton(state: .off)
329+
}
330+
331+
if localScreenSharePresenterId != nil {
332+
actionBarVC.screenShareButton.isEnabled(true, animated: true)
333+
} else if !screenSharePresenterIds.isEmpty {
334+
actionBarVC.screenShareButton.isEnabled(false, animated: true)
335+
} else {
336+
actionBarVC.screenShareButton.isEnabled(VoxeetSDK.shared.conference.mode == .standard, animated: true)
337+
}
294338
}
295339

296340
/*
@@ -562,10 +606,14 @@ extension ConferenceViewController: VTUXActiveSpeakerTimerDelegate {
562606
}
563607

564608
// Attach / Unattach video stream.
565-
let stream = participant.streams.first(where: { $0.type == .Camera })
566-
if let stream = stream, !stream.videoTracks.isEmpty {
609+
if let stream = participant.streams.first(where: { $0.type == .ScreenShare }), !stream.videoTracks.isEmpty {
567610
speakerVideoVC.attach(participant: participant, stream: stream)
568611

612+
speakerVideoVC.view.isHidden = false
613+
speakerVC.view.isHidden = true
614+
} else if let stream = participant.streams.first(where: { $0.type == .Camera }), !stream.videoTracks.isEmpty {
615+
speakerVideoVC.attach(participant: participant, stream: stream)
616+
569617
speakerVideoVC.view.isHidden = false
570618
speakerVC.view.isHidden = true
571619
} else {
@@ -676,7 +724,7 @@ extension ConferenceViewController: VTUXActionBarViewControllerDelegate {
676724
actionBarVC.screenShareButton(state: .on)
677725
VoxeetSDK.shared.conference.startScreenShare(broadcast: broadcast) { error in
678726
if error != nil {
679-
self.actionBarVC.screenShareButton(state: .off)
727+
self.updateScreenShareButton()
680728
}
681729
}
682730
} else {

VoxeetUXKit/Code/ViewControllers/UX Modules/Participants list/VTUXParticipantsViewController.swift

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,11 +177,18 @@ import VoxeetSDK
177177
if let index = activeParticipants.firstIndex(where: { $0.id == participant.id }) {
178178
let indexPath = IndexPath(row: index, section: ParticipantSection.active.rawValue)
179179
if let cell = collectionView.cellForItem(at: indexPath) as? VTUXParticipantCollectionViewCell {
180-
if let stream = participant.streams.first(where: { $0.type == .Camera }), !stream.videoTracks.isEmpty {
180+
if let stream = participant.streams.first(where: { $0.type == .ScreenShare }) {
181181
if collectionView.alpha != 0 { /* One-one call optimization */
182182
cell.avatar.isHidden = true
183183
cell.videoRenderer.isHidden = false
184184

185+
cell.videoRenderer.attach(participant: participant, stream: stream)
186+
}
187+
} else if let stream = participant.streams.first(where: { $0.type == .Camera }), !stream.videoTracks.isEmpty {
188+
if collectionView.alpha != 0 { /* One-one call optimization */
189+
cell.avatar.isHidden = true
190+
cell.videoRenderer.isHidden = false
191+
185192
cell.videoRenderer.attach(participant: participant, stream: stream)
186193
}
187194
} else {
@@ -203,6 +210,17 @@ import VoxeetSDK
203210
collectionView.reloadItems(at: indexPaths)
204211
}
205212
}
213+
214+
public func select(participant: VTParticipant) {
215+
// Select a participant.
216+
selectedParticipant = participant
217+
218+
// Reload collection view.
219+
let indexPaths = collectionView.indexPathsForVisibleItems
220+
UIView.performWithoutAnimation {
221+
collectionView.reloadItems(at: indexPaths)
222+
}
223+
}
206224

207225
@objc private func refreshVoiceLevel() {
208226
guard collectionView.alpha != 0 else { return }
@@ -377,7 +395,12 @@ extension VTUXParticipantsViewController: UICollectionViewDelegate {
377395

378396
// Unhide video renderer and attach stream.
379397
let participant = participantForItem(at: indexPath)
380-
if let stream = participant.streams.first(where: { $0.type == .Camera }), !stream.videoTracks.isEmpty {
398+
if let stream = participant.streams.first(where: { $0.type == .ScreenShare }) {
399+
cell.avatar.isHidden = true
400+
cell.videoRenderer.isHidden = false
401+
402+
cell.videoRenderer.attach(participant: participant, stream: stream)
403+
} else if let stream = participant.streams.first(where: { $0.type == .Camera }),!stream.videoTracks.isEmpty {
381404
cell.avatar.isHidden = true
382405
cell.videoRenderer.isHidden = false
383406

VoxeetUXKit/Other/settings.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@
2323
<key>UXKitBuild</key>
2424
<string>0</string>
2525
<key>UXKitVersion</key>
26-
<string>1.7.3</string>
26+
<string>1.7.4</string>
2727
</dict>
2828
</plist>

0 commit comments

Comments
 (0)