Skip to content
Merged
19 changes: 1 addition & 18 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,6 @@
{
"version": "2.0.0",
"tasks": [
{
"type": "shell",
"label": "Fastlane: Build SwiftUI Demo",
"command": "bundle exec fastlane build_swiftui_demo",
"group": {
"kind": "build",
"isDefault": true
}
},
{
"type": "shell",
"label": "Fastlane: Test StreamVideo",
"command": "bundle exec fastlane test",
"group": {
"kind": "test",
"isDefault": true
}
},

]
}
21 changes: 19 additions & 2 deletions DemoApp/Sources/Components/AppEnvironment.swift
Original file line number Diff line number Diff line change
Expand Up @@ -554,14 +554,16 @@ extension AppEnvironment {
extension AppEnvironment {

enum AudioSessionPolicyDebugConfiguration: Hashable, Debuggable, Sendable {
case `default`, ownCapabilities
case `default`, ownCapabilities, livestream

var title: String {
switch self {
case .default:
return "Default"
case .ownCapabilities:
return "OwnCapabilities"
case .livestream:
return "Livestream"
}
}

Expand All @@ -571,6 +573,8 @@ extension AppEnvironment {
return DefaultAudioSessionPolicy()
case .ownCapabilities:
return OwnCapabilitiesAudioSessionPolicy()
case .livestream:
return LivestreamAudioSessionPolicy()
}
}
}
Expand Down Expand Up @@ -616,7 +620,7 @@ extension AppEnvironment {
}

static var proximityPolicies: Set<ProximityPolicyDebugConfiguration> = {
[.speaker, .video]
[.video, .speaker]
}()
}

Expand All @@ -634,6 +638,19 @@ extension ClientCapability: Debuggable {
}
}

extension Logger.WebRTC.LogMode: Debuggable {
var title: String {
switch self {
case .none:
return "None"
case .validFilesOnly:
return "Valid Files only"
case .all:
return "All"
}
}
}

extension String: Debuggable {
var title: String {
self
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@ import Foundation
import StreamVideo

enum LogQueue {
static let queue: Queue<LogDetails> = .init(maxCount: 3000)
#if DEBUG
private static let queueCapaity = 10000
#else
private static let queueCapaity = 1000
#endif
static let queue: Queue<LogDetails> = .init(maxCount: queueCapaity)

static func insert(_ element: LogDetails) { queue.insert(element) }

Expand Down
8 changes: 4 additions & 4 deletions DemoApp/Sources/Views/Login/DebugMenu.swift
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ struct DebugMenu: View {
}

makeMenu(
for: [.default, .ownCapabilities],
for: [.default, .ownCapabilities, .livestream],
currentValue: audioSessionPolicy,
label: "AudioSession policy"
) { self.audioSessionPolicy = $0 }
Expand Down Expand Up @@ -302,10 +302,10 @@ struct DebugMenu: View {
) { LogConfig.level = $0 }

makeMenu(
for: [true, false],
currentValue: LogConfig.webRTCLogsEnabled,
for: [.none, .validFilesOnly, .all],
currentValue: Logger.WebRTC.mode,
label: "WebRTC Logs"
) { LogConfig.webRTCLogsEnabled = $0 }
) { Logger.WebRTC.mode = $0 }

Button {
isLogsViewerVisible = true
Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ let package = Package(
],
dependencies: [
.package(url: "https://github.com/apple/swift-protobuf.git", exact: "1.30.0"),
.package(url: "https://github.com/GetStream/stream-video-swift-webrtc.git", exact: "137.0.43")
.package(url: "https://github.com/GetStream/stream-video-swift-webrtc.git", exact: "137.0.52")
],
targets: [
.target(
Expand Down
17 changes: 10 additions & 7 deletions Sources/StreamVideo/Call.swift
Original file line number Diff line number Diff line change
Expand Up @@ -174,11 +174,11 @@ public class Call: @unchecked Sendable, WSEventsSubscriber {
currentStage.id == .joining {
return stateMachine
.publisher
.tryCompactMap {
switch $0.id {
.tryMap { (stage) -> JoinCallResponse? in
switch stage.id {
case .joined:
guard
let stage = $0 as? Call.StateMachine.Stage.JoinedStage
let stage = stage as? Call.StateMachine.Stage.JoinedStage
else {
throw ClientError()
}
Expand All @@ -190,7 +190,7 @@ public class Call: @unchecked Sendable, WSEventsSubscriber {
}
case .error:
guard
let stage = $0 as? Call.StateMachine.Stage.ErrorStage
let stage = stage as? Call.StateMachine.Stage.ErrorStage
else {
throw ClientError()
}
Expand All @@ -201,7 +201,7 @@ public class Call: @unchecked Sendable, WSEventsSubscriber {
}
.eraseToAnyPublisher()
} else {
let deliverySubject = PassthroughSubject<JoinCallResponse, Error>()
let deliverySubject = CurrentValueSubject<JoinCallResponse?, Error>(nil)
transitionHandler(
.joining(
self,
Expand All @@ -224,8 +224,11 @@ public class Call: @unchecked Sendable, WSEventsSubscriber {

if let joinResponse = result as? JoinCallResponse {
return joinResponse
} else if let publisher = result as? AnyPublisher<JoinCallResponse, Error> {
return try await publisher.nextValue(timeout: CallConfiguration.timeout.join)
} else if let publisher = result as? AnyPublisher<JoinCallResponse?, Error> {
let result = try await publisher
.compactMap { $0 }
.nextValue(timeout: CallConfiguration.timeout.join)
return result
} else {
throw ClientError("Call was unable to join call.")
}
Expand Down
Loading
Loading