Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ jobs:
fail-fast: false
matrix:
include:
- platform: "iOS Simulator,name=iPhone 17 Pro,OS=26.4.1"
- platform: "iOS Simulator,name=iPhone 17 Pro,OS=26.5"
- platform: "macOS"
steps:
- uses: actions/checkout@v6

- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: 26.4
xcode-version: 26.5

- name: Resolve Packages
run: |
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,6 @@ iOSInjectionProject/

# Ignore license files
*.license

# Claude Code
.claude/

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 9 additions & 5 deletions LiveKitExample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
7BBEBA832D791CB300586EC4 /* CIImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7BBEBA822D791CAF00586EC4 /* CIImage.swift */; };
7BBEBA892D79219600586EC4 /* LKButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7BBEBA882D79219600586EC4 /* LKButton.swift */; };
7BBEBA8B2D7921AA00586EC4 /* LKTextField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7BBEBA8A2D7921AA00586EC4 /* LKTextField.swift */; };
7BBEBA9A2D79219600586EC4 /* View+OnChange.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7BBEBA9B2D79219600586EC4 /* View+OnChange.swift */; };
B5BCF77E2CFE7FDE00BCD4D8 /* BroadcastExt.appex in Embed Foundation Extensions */ = {isa = PBXBuildFile; fileRef = 683F05F3273F96B20080C7AC /* BroadcastExt.appex */; platformFilters = (ios, tvos, xros, ); settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
B5BCF7842CFE859A00BCD4D8 /* LiveKit in Frameworks */ = {isa = PBXBuildFile; productRef = B5BCF7832CFE859A00BCD4D8 /* LiveKit */; };
B5C2EF162D0114C800FAC766 /* LiveKitComponents in Frameworks */ = {isa = PBXBuildFile; productRef = B5C2EF152D0114C800FAC766 /* LiveKitComponents */; };
Expand Down Expand Up @@ -101,6 +102,7 @@
7BBEBA822D791CAF00586EC4 /* CIImage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CIImage.swift; sourceTree = "<group>"; };
7BBEBA882D79219600586EC4 /* LKButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LKButton.swift; sourceTree = "<group>"; };
7BBEBA8A2D7921AA00586EC4 /* LKTextField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LKTextField.swift; sourceTree = "<group>"; };
7BBEBA9B2D79219600586EC4 /* View+OnChange.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "View+OnChange.swift"; sourceTree = "<group>"; };
9E7835E62751A71500559DEC /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.0.sdk/System/Library/Frameworks/CoreGraphics.framework; sourceTree = DEVELOPER_DIR; };
D7AA477A285A0FFC00EB41AE /* SampleHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SampleHandler.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */
Expand Down Expand Up @@ -247,6 +249,7 @@
7BBEBA822D791CAF00586EC4 /* CIImage.swift */,
68A50ECB2C4C1ED500D2DE17 /* Binding+OptionSet.swift */,
68A50ECC2C4C1ED500D2DE17 /* Bundle.swift */,
7BBEBA9B2D79219600586EC4 /* View+OnChange.swift */,
);
path = Extensions;
sourceTree = "<group>";
Expand Down Expand Up @@ -398,6 +401,7 @@
68A50EE82C4C1ED500D2DE17 /* ScreenShareSourcePickerView.swift in Sources */,
68A50EEA2C4C1ED500D2DE17 /* Participant+Helpers.swift in Sources */,
68A50EEB2C4C1ED500D2DE17 /* Binding+OptionSet.swift in Sources */,
7BBEBA9A2D79219600586EC4 /* View+OnChange.swift in Sources */,
6888FBE12C66B7B400AB93C1 /* ImmersiveView.swift in Sources */,
68A50EEC2C4C1ED500D2DE17 /* ParticipantView.swift in Sources */,
7BBEBA832D791CB300586EC4 /* CIImage.swift in Sources */,
Expand Down Expand Up @@ -646,7 +650,7 @@
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 20260504;
CURRENT_PROJECT_VERSION = 20260609;
DEAD_CODE_STRIPPING = YES;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = 76TVFCUKK7;
Expand All @@ -668,7 +672,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MARKETING_VERSION = 2.14.0;
MARKETING_VERSION = 2.15.0;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
Expand Down Expand Up @@ -715,7 +719,7 @@
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 20260504;
CURRENT_PROJECT_VERSION = 20260609;
DEAD_CODE_STRIPPING = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = 76TVFCUKK7;
Expand All @@ -732,7 +736,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MARKETING_VERSION = 2.14.0;
MARKETING_VERSION = 2.15.0;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
STRING_CATALOG_GENERATE_SYMBOLS = YES;
Expand Down Expand Up @@ -797,7 +801,7 @@
repositoryURL = "https://github.com/livekit/client-sdk-swift";
requirement = {
kind = exactVersion;
version = 2.14.1;
version = 2.15.0;
};
};
B5C2EF142D0114C800FAC766 /* XCRemoteSwiftPackageReference "components-swift" */ = {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 27 additions & 0 deletions Multiplatform/Extensions/View+OnChange.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* Copyright 2026 LiveKit
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import SwiftUI

#if !os(tvOS) && !os(visionOS)
extension View {
@available(iOS, introduced: 14.0, obsoleted: 17.0)
@available(macOS, introduced: 11.0, obsoleted: 14.0)
func onChange(of value: some Equatable, _ action: @escaping () -> Void) -> some View {
onChange(of: value) { _ in action() }
}
}
#endif
16 changes: 12 additions & 4 deletions Multiplatform/Views/ConnectView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,12 @@ struct ConnectView: View {

LKButton(title: "Connect") {
Task { @MainActor in
let room = try await roomCtx.connect()
appCtx.connectionHistory.update(room: room, e2ee: roomCtx.isE2eeEnabled, e2eeKey: roomCtx.e2eeKey)
do {
let room = try await roomCtx.connect()
appCtx.connectionHistory.update(room: room, e2ee: roomCtx.isE2eeEnabled, e2eeKey: roomCtx.e2eeKey)
} catch {
print("Failed to connect: \(error)")
}
}
}

Expand All @@ -107,8 +111,12 @@ struct ConnectView: View {
ForEach(appCtx.connectionHistory.sortedByUpdated) { entry in
Button {
Task { @MainActor in
let room = try await roomCtx.connect(entry: entry)
appCtx.connectionHistory.update(room: room, e2ee: roomCtx.isE2eeEnabled, e2eeKey: roomCtx.e2eeKey)
do {
let room = try await roomCtx.connect(entry: entry)
appCtx.connectionHistory.update(room: room, e2ee: roomCtx.isE2eeEnabled, e2eeKey: roomCtx.e2eeKey)
} catch {
print("Failed to connect: \(error)")
}
}
} label: {
Image(systemSymbol: .boltFill)
Expand Down
4 changes: 2 additions & 2 deletions Multiplatform/Views/MessagesPanel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ struct MessagesPanel: View {
.onAppear(perform: {
scrollToBottom(scrollView)
})
.onChange(of: roomCtx.messages, perform: { _ in
.onChange(of: roomCtx.messages) {
scrollToBottom(scrollView)
})
}
.frame(
minWidth: 0,
maxWidth: .infinity,
Expand Down
12 changes: 8 additions & 4 deletions Multiplatform/Views/ParticipantView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,11 @@ struct ParticipantView: View {
Menu {
if case .subscribed = remotePub.subscriptionState {
Button("Unsubscribe") {
Task { try await remotePub.set(subscribed: false) }
Task { try? await remotePub.set(subscribed: false) }
}
} else if case .unsubscribed = remotePub.subscriptionState {
Button("Subscribe") {
Task { try await remotePub.set(subscribed: true) }
Task { try? await remotePub.set(subscribed: true) }
}
}
} label: {
Expand Down Expand Up @@ -185,11 +185,11 @@ struct ParticipantView: View {
Menu {
if case .subscribed = remotePub.subscriptionState {
Button("Unsubscribe") {
Task { try await remotePub.set(subscribed: false) }
Task { try? await remotePub.set(subscribed: false) }
}
} else if case .unsubscribed = remotePub.subscriptionState {
Button("Subscribe") {
Task { try await remotePub.set(subscribed: true) }
Task { try? await remotePub.set(subscribed: true) }
}
}
} label: {
Expand Down Expand Up @@ -221,11 +221,13 @@ struct ParticipantView: View {
.foregroundColor(Color.white)
}

#if !os(tvOS)
ForEach(remoteAudioTracks) { remoteAudioTrack in
RemoteAudioVolumeControl(track: remoteAudioTrack,
showsPercentage: geometry.size.width > 180)
.fixedSize()
}
#endif

if participant.connectionQuality == .excellent {
Image(systemSymbol: .wifi)
Expand Down Expand Up @@ -267,6 +269,7 @@ struct ParticipantView: View {
}
}

#if !os(tvOS)
struct RemoteAudioVolumeControl: View {
let track: RemoteAudioTrack
let showsPercentage: Bool
Expand Down Expand Up @@ -375,6 +378,7 @@ private extension View {
#endif
}
}
#endif

struct StatsView: View {
private let track: Track
Expand Down
12 changes: 7 additions & 5 deletions Multiplatform/Views/PublishOptionsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ struct PublishOptionsView: View {
ForEach(VideoCodec.all) {
Text($0.id.uppercased()).tag($0 as VideoCodec?)
}
}.onChange(of: preferredVideoCodec) { newValue in
if newValue?.isSVC ?? false {
}.onChange(of: preferredVideoCodec) {
if preferredVideoCodec?.isSVC ?? false {
preferredBackupVideoCodec = .vp8
} else {
preferredBackupVideoCodec = nil
Expand Down Expand Up @@ -160,9 +160,11 @@ struct PublishOptionsView: View {
}
.onAppear(perform: {
Task {
devices = try await CameraCapturer.captureDevices()
#if !os(macOS)
.singleDeviceforEachPosition()
let all = await (try? CameraCapturer.captureDevices()) ?? []
#if os(macOS)
devices = all
#else
devices = all.singleDeviceforEachPosition()
#endif
}
})
Expand Down
8 changes: 6 additions & 2 deletions Multiplatform/Views/RoomContextView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,12 @@ struct RoomContextView: View {
roomCtx.isE2eeEnabled = e2ee
roomCtx.e2eeKey = e2eeKey
if !roomCtx.token.isEmpty {
let room = try await roomCtx.connect()
appCtx.connectionHistory.update(room: room, e2ee: e2ee, e2eeKey: e2eeKey)
do {
let room = try await roomCtx.connect()
appCtx.connectionHistory.update(room: room, e2ee: e2ee, e2eeKey: e2eeKey)
} catch {
print("Failed to connect: \(error)")
}
}
}
})
Expand Down
10 changes: 4 additions & 6 deletions Multiplatform/Views/RoomSwitchView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,14 @@ struct RoomSwitchView: View {
}
.preferredColorScheme(.dark)
.navigationTitle(navigatonTitle)
.onChange(of: shouldShowRoomView) { newValue in
#if os(visionOS)
Task {
if newValue {
#if os(visionOS)
.task(id: shouldShowRoomView) {
if shouldShowRoomView {
await openImmersiveSpace(id: "ImmersiveSpace")
} else {
await dismissImmersiveSpace()
}
}
#endif
}
#endif
}
}
Loading