From 7bc6c4083d40ab509bb9ae43d3a4e318c4210c79 Mon Sep 17 00:00:00 2001 From: cloudwebrtc Date: Tue, 15 Sep 2026 15:13:10 +0800 Subject: [PATCH] Add an Enable WARP toggle to Connect Options Sits under Enable E2EE and is persisted with the other preferences, so the choice survives a relaunch. The setting is process-global in the SDK and applies to rooms connected afterwards, so RoomContext pushes it to LiveKitSDK as soon as it changes, and again when the stored value is loaded at startup. Also picks up the Package.resolved the current SDK checkout resolves to. Co-Authored-By: Claude Opus 5 (1M context) --- .../xcshareddata/swiftpm/Package.resolved | 19 ++++++++++++++----- Multiplatform/Controllers/RoomContext.swift | 9 +++++++++ Multiplatform/Support/SecureStore.swift | 1 + Multiplatform/Views/ConnectView.swift | 1 + 4 files changed, 25 insertions(+), 5 deletions(-) diff --git a/LiveKitExample-dev.xcworkspace/xcshareddata/swiftpm/Package.resolved b/LiveKitExample-dev.xcworkspace/xcshareddata/swiftpm/Package.resolved index 67a1a2d..24fceff 100644 --- a/LiveKitExample-dev.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/LiveKitExample-dev.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -1,6 +1,15 @@ { - "originHash" : "649726dbcfe1a05ec4b7f7de9bfc8bfc7da4ca529035a2019e083625beb23d5b", + "originHash" : "e402f524d9792b1de232168f726eb68ff57b9dea7a714abd6c2ab6ec4d6b167d", "pins" : [ + { + "identity" : "components-swift", + "kind" : "remoteSourceControl", + "location" : "https://github.com/livekit/components-swift", + "state" : { + "revision" : "9f28db3ae5d2b51f3033ea725c952ddacb5657d0", + "version" : "0.1.7" + } + }, { "identity" : "keychainaccess", "kind" : "remoteSourceControl", @@ -15,8 +24,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/livekit/livekit-uniffi-xcframework.git", "state" : { - "revision" : "7c161254ce7cd55debc48023f69a917076b12a26", - "version" : "0.0.6" + "revision" : "7a9bf91b1601d5c408ae0cac7dc2047b5a4f615e", + "version" : "0.1.9" } }, { @@ -60,8 +69,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/livekit/webrtc-xcframework.git", "state" : { - "revision" : "46f2af86f06b9a8a9158d37cadda5cb5a214e4c4", - "version" : "144.7559.11" + "revision" : "c73deceaddd9c07293871ae28f24d4326cc86d62", + "version" : "150.7871.2" } } ], diff --git a/Multiplatform/Controllers/RoomContext.swift b/Multiplatform/Controllers/RoomContext.swift index 8c35397..81edef3 100644 --- a/Multiplatform/Controllers/RoomContext.swift +++ b/Multiplatform/Controllers/RoomContext.swift @@ -51,6 +51,14 @@ final class RoomContext: ObservableObject { } } + // Process-global, applies to rooms connected after it is set. + @Published var isWARPEnabled: Bool = false { + didSet { + store.value.isWARPEnabled = isWARPEnabled + LiveKitSDK.setWARPEnabled(isWARPEnabled) + } + } + // RoomOptions @Published var simulcast: Bool = true { didSet { store.value.simulcast = simulcast } @@ -118,6 +126,7 @@ final class RoomContext: ObservableObject { url = store.value.url token = store.value.token isE2eeEnabled = store.value.isE2eeEnabled + isWARPEnabled = store.value.isWARPEnabled e2eeKey = store.value.e2eeKey simulcast = store.value.simulcast adaptiveStream = store.value.adaptiveStream diff --git a/Multiplatform/Support/SecureStore.swift b/Multiplatform/Support/SecureStore.swift index 3566f4a..c5552b0 100644 --- a/Multiplatform/Support/SecureStore.swift +++ b/Multiplatform/Support/SecureStore.swift @@ -24,6 +24,7 @@ struct Preferences: Codable, Equatable { var token = "" var e2eeKey = "" var isE2eeEnabled = false + var isWARPEnabled = false // Connect options var autoSubscribe = true diff --git a/Multiplatform/Views/ConnectView.swift b/Multiplatform/Views/ConnectView.swift index f27e612..373e3d9 100644 --- a/Multiplatform/Views/ConnectView.swift +++ b/Multiplatform/Views/ConnectView.swift @@ -49,6 +49,7 @@ struct ConnectView: View { Menu { Toggle("Auto-Subscribe", isOn: $roomCtx.autoSubscribe) Toggle("Enable E2EE", isOn: $roomCtx.isE2eeEnabled) + Toggle("Enable WARP", isOn: $roomCtx.isWARPEnabled) } label: { Image(systemSymbol: .boltFill) .renderingMode(.original)