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
1 change: 1 addition & 0 deletions .changes/options-init
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
patch type="fixed" "RoomOptions init collision"
38 changes: 8 additions & 30 deletions Sources/LiveKit/Types/Options/RoomOptions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import Foundation

@objc
public final class RoomOptions: NSObject, Sendable {
public final class RoomOptions: NSObject, Sendable, Loggable {
// default options for capturing
@objc
public let defaultCameraCaptureOptions: CameraCaptureOptions
Expand Down Expand Up @@ -65,7 +65,7 @@

/// E2EE Options
@objc
public let e2eeOptions: E2EEOptions?

Check warning on line 68 in Sources/LiveKit/Types/Options/RoomOptions.swift

View workflow job for this annotation

GitHub Actions / Build & Test (macos-14, 15.4, macOS)

'E2EEOptions' is deprecated: Migrate to 'EncryptionOptions' instead. Important: It will enable data channel encryption by default (requires support from all platforms).

Check warning on line 68 in Sources/LiveKit/Types/Options/RoomOptions.swift

View workflow job for this annotation

GitHub Actions / Build & Test (macos-14, 15.4, macOS)

'E2EEOptions' is deprecated: Migrate to 'EncryptionOptions' instead. Important: It will enable data channel encryption by default (requires support from all platforms).

Check warning on line 68 in Sources/LiveKit/Types/Options/RoomOptions.swift

View workflow job for this annotation

GitHub Actions / Build & Test (macos-26, latest, macOS)

'E2EEOptions' is deprecated: Migrate to 'EncryptionOptions' instead. Important: It will enable data channel encryption by default (requires support from all platforms).

Check warning on line 68 in Sources/LiveKit/Types/Options/RoomOptions.swift

View workflow job for this annotation

GitHub Actions / Build & Test (macos-26, latest, macOS)

'E2EEOptions' is deprecated: Migrate to 'EncryptionOptions' instead. Important: It will enable data channel encryption by default (requires support from all platforms).

Check warning on line 68 in Sources/LiveKit/Types/Options/RoomOptions.swift

View workflow job for this annotation

GitHub Actions / Build & Test (macos-14, 15.4, macOS,variant=Mac Catalyst)

'E2EEOptions' is deprecated: Migrate to 'EncryptionOptions' instead. Important: It will enable data channel encryption by default (requires support from all platforms).

Check warning on line 68 in Sources/LiveKit/Types/Options/RoomOptions.swift

View workflow job for this annotation

GitHub Actions / Build & Test (macos-14, 15.4, tvOS Simulator,name=Apple TV,OS=17.5)

'E2EEOptions' is deprecated: Migrate to 'EncryptionOptions' instead. Important: It will enable data channel encryption by default (requires support from all platforms).

Check warning on line 68 in Sources/LiveKit/Types/Options/RoomOptions.swift

View workflow job for this annotation

GitHub Actions / Build & Test (macos-14, 15.4, tvOS Simulator,name=Apple TV,OS=17.5)

'E2EEOptions' is deprecated: Migrate to 'EncryptionOptions' instead. Important: It will enable data channel encryption by default (requires support from all platforms).

Check warning on line 68 in Sources/LiveKit/Types/Options/RoomOptions.swift

View workflow job for this annotation

GitHub Actions / Build & Test (macos-15, 16.4, macOS,variant=Mac Catalyst)

'E2EEOptions' is deprecated: Migrate to 'EncryptionOptions' instead. Important: It will enable data channel encryption by default (requires support from all platforms).

Check warning on line 68 in Sources/LiveKit/Types/Options/RoomOptions.swift

View workflow job for this annotation

GitHub Actions / Build & Test (macos-26, latest, tvOS Simulator,name=Apple TV,OS=26.0)

'E2EEOptions' is deprecated: Migrate to 'EncryptionOptions' instead. Important: It will enable data channel encryption by default (requires support from all platforms).

Check warning on line 68 in Sources/LiveKit/Types/Options/RoomOptions.swift

View workflow job for this annotation

GitHub Actions / Build & Test (macos-26, latest, tvOS Simulator,name=Apple TV,OS=26.0)

'E2EEOptions' is deprecated: Migrate to 'EncryptionOptions' instead. Important: It will enable data channel encryption by default (requires support from all platforms).

Check warning on line 68 in Sources/LiveKit/Types/Options/RoomOptions.swift

View workflow job for this annotation

GitHub Actions / Build & Test (macos-26, latest, macOS,variant=Mac Catalyst)

'E2EEOptions' is deprecated: Migrate to 'EncryptionOptions' instead. Important: It will enable data channel encryption by default (requires support from all platforms).

Check warning on line 68 in Sources/LiveKit/Types/Options/RoomOptions.swift

View workflow job for this annotation

GitHub Actions / Build & Test (macos-14, 15.4, iOS Simulator,name=iPhone 15 Pro,OS=17.5)

'E2EEOptions' is deprecated: Migrate to 'EncryptionOptions' instead. Important: It will enable data channel encryption by default (requires support from all platforms).

Check warning on line 68 in Sources/LiveKit/Types/Options/RoomOptions.swift

View workflow job for this annotation

GitHub Actions / Build & Test (macos-14, 15.4, iOS Simulator,name=iPhone 15 Pro,OS=17.5)

'E2EEOptions' is deprecated: Migrate to 'EncryptionOptions' instead. Important: It will enable data channel encryption by default (requires support from all platforms).

Check warning on line 68 in Sources/LiveKit/Types/Options/RoomOptions.swift

View workflow job for this annotation

GitHub Actions / Build & Test (macos-15, 16.4, tvOS Simulator,name=Apple TV,OS=18.5)

'E2EEOptions' is deprecated: Migrate to 'EncryptionOptions' instead. Important: It will enable data channel encryption by default (requires support from all platforms).

Check warning on line 68 in Sources/LiveKit/Types/Options/RoomOptions.swift

View workflow job for this annotation

GitHub Actions / Build & Test (macos-15, 16.4, tvOS Simulator,name=Apple TV,OS=18.5)

'E2EEOptions' is deprecated: Migrate to 'EncryptionOptions' instead. Important: It will enable data channel encryption by default (requires support from all platforms).

Check warning on line 68 in Sources/LiveKit/Types/Options/RoomOptions.swift

View workflow job for this annotation

GitHub Actions / Build & Test (macos-15, 16.4, macOS, true)

'E2EEOptions' is deprecated: Migrate to 'EncryptionOptions' instead. Important: It will enable data channel encryption by default (requires support from all platforms).

Check warning on line 68 in Sources/LiveKit/Types/Options/RoomOptions.swift

View workflow job for this annotation

GitHub Actions / Build & Test (macos-15, 16.4, macOS, true)

'E2EEOptions' is deprecated: Migrate to 'EncryptionOptions' instead. Important: It will enable data channel encryption by default (requires support from all platforms).

Check warning on line 68 in Sources/LiveKit/Types/Options/RoomOptions.swift

View workflow job for this annotation

GitHub Actions / Build & Test (macos-15, 16.4, macOS, true)

'E2EEOptions' is deprecated: Migrate to 'EncryptionOptions' instead. Important: It will enable data channel encryption by default (requires support from all platforms).

Check warning on line 68 in Sources/LiveKit/Types/Options/RoomOptions.swift

View workflow job for this annotation

GitHub Actions / Build & Test (macos-15, 16.4, visionOS Simulator,name=Apple Vision Pro,OS=2.5)

'E2EEOptions' is deprecated: Migrate to 'EncryptionOptions' instead. Important: It will enable data channel encryption by default (requires support from all platforms).

Check warning on line 68 in Sources/LiveKit/Types/Options/RoomOptions.swift

View workflow job for this annotation

GitHub Actions / Build & Test (macos-15, 16.4, visionOS Simulator,name=Apple Vision Pro,OS=2.5)

'E2EEOptions' is deprecated: Migrate to 'EncryptionOptions' instead. Important: It will enable data channel encryption by default (requires support from all platforms).

Check warning on line 68 in Sources/LiveKit/Types/Options/RoomOptions.swift

View workflow job for this annotation

GitHub Actions / Build & Test (macos-26, latest, iOS Simulator,name=iPhone 17 Pro,OS=26.0)

'E2EEOptions' is deprecated: Migrate to 'EncryptionOptions' instead. Important: It will enable data channel encryption by default (requires support from all platforms).

Check warning on line 68 in Sources/LiveKit/Types/Options/RoomOptions.swift

View workflow job for this annotation

GitHub Actions / Build & Test (macos-15, 16.4, iOS Simulator,name=iPhone 16 Pro,OS=18.5, true)

'E2EEOptions' is deprecated: Migrate to 'EncryptionOptions' instead. Important: It will enable data channel encryption by default (requires support from all platforms).

Check warning on line 68 in Sources/LiveKit/Types/Options/RoomOptions.swift

View workflow job for this annotation

GitHub Actions / Build & Test (macos-15, 16.4, iOS Simulator,name=iPhone 16 Pro,OS=18.5, true)

'E2EEOptions' is deprecated: Migrate to 'EncryptionOptions' instead. Important: It will enable data channel encryption by default (requires support from all platforms).

Check warning on line 68 in Sources/LiveKit/Types/Options/RoomOptions.swift

View workflow job for this annotation

GitHub Actions / Build & Test (macos-15, 16.4, iOS Simulator,name=iPhone 16 Pro,OS=18.5, true)

'E2EEOptions' is deprecated: Migrate to 'EncryptionOptions' instead. Important: It will enable data channel encryption by default (requires support from all platforms).

Check warning on line 68 in Sources/LiveKit/Types/Options/RoomOptions.swift

View workflow job for this annotation

GitHub Actions / Build & Test (macos-26, latest, visionOS Simulator,name=Apple Vision Pro,OS=26.0)

'E2EEOptions' is deprecated: Migrate to 'EncryptionOptions' instead. Important: It will enable data channel encryption by default (requires support from all platforms).

Check warning on line 68 in Sources/LiveKit/Types/Options/RoomOptions.swift

View workflow job for this annotation

GitHub Actions / Build & Test (macos-26, latest, visionOS Simulator,name=Apple Vision Pro,OS=26.0)

'E2EEOptions' is deprecated: Migrate to 'EncryptionOptions' instead. Important: It will enable data channel encryption by default (requires support from all platforms).
/// Encryption
@objc
public let encryptionOptions: EncryptionOptions?
Expand Down Expand Up @@ -100,35 +100,7 @@
dynacast: Bool = false,
stopLocalTrackOnUnpublish: Bool = true,
suspendLocalVideoTracksInBackground: Bool = true,
e2eeOptions: E2EEOptions? = nil,

Check warning on line 103 in Sources/LiveKit/Types/Options/RoomOptions.swift

View workflow job for this annotation

GitHub Actions / Build & Test (macos-14, 15.4, macOS)

'E2EEOptions' is deprecated: Migrate to 'EncryptionOptions' instead. Important: It will enable data channel encryption by default (requires support from all platforms).

Check warning on line 103 in Sources/LiveKit/Types/Options/RoomOptions.swift

View workflow job for this annotation

GitHub Actions / Build & Test (macos-14, 15.4, macOS)

'E2EEOptions' is deprecated: Migrate to 'EncryptionOptions' instead. Important: It will enable data channel encryption by default (requires support from all platforms).

Check warning on line 103 in Sources/LiveKit/Types/Options/RoomOptions.swift

View workflow job for this annotation

GitHub Actions / Build & Test (macos-26, latest, macOS)

'E2EEOptions' is deprecated: Migrate to 'EncryptionOptions' instead. Important: It will enable data channel encryption by default (requires support from all platforms).

Check warning on line 103 in Sources/LiveKit/Types/Options/RoomOptions.swift

View workflow job for this annotation

GitHub Actions / Build & Test (macos-26, latest, macOS)

'E2EEOptions' is deprecated: Migrate to 'EncryptionOptions' instead. Important: It will enable data channel encryption by default (requires support from all platforms).

Check warning on line 103 in Sources/LiveKit/Types/Options/RoomOptions.swift

View workflow job for this annotation

GitHub Actions / Build & Test (macos-14, 15.4, macOS,variant=Mac Catalyst)

'E2EEOptions' is deprecated: Migrate to 'EncryptionOptions' instead. Important: It will enable data channel encryption by default (requires support from all platforms).

Check warning on line 103 in Sources/LiveKit/Types/Options/RoomOptions.swift

View workflow job for this annotation

GitHub Actions / Build & Test (macos-14, 15.4, tvOS Simulator,name=Apple TV,OS=17.5)

'E2EEOptions' is deprecated: Migrate to 'EncryptionOptions' instead. Important: It will enable data channel encryption by default (requires support from all platforms).

Check warning on line 103 in Sources/LiveKit/Types/Options/RoomOptions.swift

View workflow job for this annotation

GitHub Actions / Build & Test (macos-14, 15.4, tvOS Simulator,name=Apple TV,OS=17.5)

'E2EEOptions' is deprecated: Migrate to 'EncryptionOptions' instead. Important: It will enable data channel encryption by default (requires support from all platforms).

Check warning on line 103 in Sources/LiveKit/Types/Options/RoomOptions.swift

View workflow job for this annotation

GitHub Actions / Build & Test (macos-15, 16.4, macOS,variant=Mac Catalyst)

'E2EEOptions' is deprecated: Migrate to 'EncryptionOptions' instead. Important: It will enable data channel encryption by default (requires support from all platforms).

Check warning on line 103 in Sources/LiveKit/Types/Options/RoomOptions.swift

View workflow job for this annotation

GitHub Actions / Build & Test (macos-26, latest, tvOS Simulator,name=Apple TV,OS=26.0)

'E2EEOptions' is deprecated: Migrate to 'EncryptionOptions' instead. Important: It will enable data channel encryption by default (requires support from all platforms).

Check warning on line 103 in Sources/LiveKit/Types/Options/RoomOptions.swift

View workflow job for this annotation

GitHub Actions / Build & Test (macos-26, latest, tvOS Simulator,name=Apple TV,OS=26.0)

'E2EEOptions' is deprecated: Migrate to 'EncryptionOptions' instead. Important: It will enable data channel encryption by default (requires support from all platforms).

Check warning on line 103 in Sources/LiveKit/Types/Options/RoomOptions.swift

View workflow job for this annotation

GitHub Actions / Build & Test (macos-26, latest, macOS,variant=Mac Catalyst)

'E2EEOptions' is deprecated: Migrate to 'EncryptionOptions' instead. Important: It will enable data channel encryption by default (requires support from all platforms).

Check warning on line 103 in Sources/LiveKit/Types/Options/RoomOptions.swift

View workflow job for this annotation

GitHub Actions / Build & Test (macos-14, 15.4, iOS Simulator,name=iPhone 15 Pro,OS=17.5)

'E2EEOptions' is deprecated: Migrate to 'EncryptionOptions' instead. Important: It will enable data channel encryption by default (requires support from all platforms).

Check warning on line 103 in Sources/LiveKit/Types/Options/RoomOptions.swift

View workflow job for this annotation

GitHub Actions / Build & Test (macos-15, 16.4, tvOS Simulator,name=Apple TV,OS=18.5)

'E2EEOptions' is deprecated: Migrate to 'EncryptionOptions' instead. Important: It will enable data channel encryption by default (requires support from all platforms).

Check warning on line 103 in Sources/LiveKit/Types/Options/RoomOptions.swift

View workflow job for this annotation

GitHub Actions / Build & Test (macos-15, 16.4, tvOS Simulator,name=Apple TV,OS=18.5)

'E2EEOptions' is deprecated: Migrate to 'EncryptionOptions' instead. Important: It will enable data channel encryption by default (requires support from all platforms).

Check warning on line 103 in Sources/LiveKit/Types/Options/RoomOptions.swift

View workflow job for this annotation

GitHub Actions / Build & Test (macos-15, 16.4, macOS, true)

'E2EEOptions' is deprecated: Migrate to 'EncryptionOptions' instead. Important: It will enable data channel encryption by default (requires support from all platforms).

Check warning on line 103 in Sources/LiveKit/Types/Options/RoomOptions.swift

View workflow job for this annotation

GitHub Actions / Build & Test (macos-15, 16.4, macOS, true)

'E2EEOptions' is deprecated: Migrate to 'EncryptionOptions' instead. Important: It will enable data channel encryption by default (requires support from all platforms).

Check warning on line 103 in Sources/LiveKit/Types/Options/RoomOptions.swift

View workflow job for this annotation

GitHub Actions / Build & Test (macos-15, 16.4, macOS, true)

'E2EEOptions' is deprecated: Migrate to 'EncryptionOptions' instead. Important: It will enable data channel encryption by default (requires support from all platforms).

Check warning on line 103 in Sources/LiveKit/Types/Options/RoomOptions.swift

View workflow job for this annotation

GitHub Actions / Build & Test (macos-15, 16.4, visionOS Simulator,name=Apple Vision Pro,OS=2.5)

'E2EEOptions' is deprecated: Migrate to 'EncryptionOptions' instead. Important: It will enable data channel encryption by default (requires support from all platforms).

Check warning on line 103 in Sources/LiveKit/Types/Options/RoomOptions.swift

View workflow job for this annotation

GitHub Actions / Build & Test (macos-15, 16.4, visionOS Simulator,name=Apple Vision Pro,OS=2.5)

'E2EEOptions' is deprecated: Migrate to 'EncryptionOptions' instead. Important: It will enable data channel encryption by default (requires support from all platforms).

Check warning on line 103 in Sources/LiveKit/Types/Options/RoomOptions.swift

View workflow job for this annotation

GitHub Actions / Build & Test (macos-26, latest, iOS Simulator,name=iPhone 17 Pro,OS=26.0)

'E2EEOptions' is deprecated: Migrate to 'EncryptionOptions' instead. Important: It will enable data channel encryption by default (requires support from all platforms).

Check warning on line 103 in Sources/LiveKit/Types/Options/RoomOptions.swift

View workflow job for this annotation

GitHub Actions / Build & Test (macos-15, 16.4, iOS Simulator,name=iPhone 16 Pro,OS=18.5, true)

'E2EEOptions' is deprecated: Migrate to 'EncryptionOptions' instead. Important: It will enable data channel encryption by default (requires support from all platforms).

Check warning on line 103 in Sources/LiveKit/Types/Options/RoomOptions.swift

View workflow job for this annotation

GitHub Actions / Build & Test (macos-15, 16.4, iOS Simulator,name=iPhone 16 Pro,OS=18.5, true)

'E2EEOptions' is deprecated: Migrate to 'EncryptionOptions' instead. Important: It will enable data channel encryption by default (requires support from all platforms).

Check warning on line 103 in Sources/LiveKit/Types/Options/RoomOptions.swift

View workflow job for this annotation

GitHub Actions / Build & Test (macos-15, 16.4, iOS Simulator,name=iPhone 16 Pro,OS=18.5, true)

'E2EEOptions' is deprecated: Migrate to 'EncryptionOptions' instead. Important: It will enable data channel encryption by default (requires support from all platforms).

Check warning on line 103 in Sources/LiveKit/Types/Options/RoomOptions.swift

View workflow job for this annotation

GitHub Actions / Build & Test (macos-26, latest, visionOS Simulator,name=Apple Vision Pro,OS=26.0)

'E2EEOptions' is deprecated: Migrate to 'EncryptionOptions' instead. Important: It will enable data channel encryption by default (requires support from all platforms).
reportRemoteTrackStatistics: Bool = false)
{
self.defaultCameraCaptureOptions = defaultCameraCaptureOptions
self.defaultScreenShareCaptureOptions = defaultScreenShareCaptureOptions
self.defaultAudioCaptureOptions = defaultAudioCaptureOptions
self.defaultVideoPublishOptions = defaultVideoPublishOptions
self.defaultAudioPublishOptions = defaultAudioPublishOptions
self.defaultDataPublishOptions = defaultDataPublishOptions
self.adaptiveStream = adaptiveStream
self.dynacast = dynacast
self.stopLocalTrackOnUnpublish = stopLocalTrackOnUnpublish
self.suspendLocalVideoTracksInBackground = suspendLocalVideoTracksInBackground
self.e2eeOptions = e2eeOptions
encryptionOptions = nil // don't pass both
self.reportRemoteTrackStatistics = reportRemoteTrackStatistics
}

@objc
public init(defaultCameraCaptureOptions: CameraCaptureOptions = CameraCaptureOptions(),
defaultScreenShareCaptureOptions: ScreenShareCaptureOptions = ScreenShareCaptureOptions(),
defaultAudioCaptureOptions: AudioCaptureOptions = AudioCaptureOptions(),
defaultVideoPublishOptions: VideoPublishOptions = VideoPublishOptions(),
defaultAudioPublishOptions: AudioPublishOptions = AudioPublishOptions(),
defaultDataPublishOptions: DataPublishOptions = DataPublishOptions(),
adaptiveStream: Bool = false,
dynacast: Bool = false,
stopLocalTrackOnUnpublish: Bool = true,
suspendLocalVideoTracksInBackground: Bool = true,
encryptionOptions: EncryptionOptions? = nil,
reportRemoteTrackStatistics: Bool = false)
{
Expand All @@ -142,9 +114,15 @@
self.dynacast = dynacast
self.stopLocalTrackOnUnpublish = stopLocalTrackOnUnpublish
self.suspendLocalVideoTracksInBackground = suspendLocalVideoTracksInBackground
e2eeOptions = nil // don't pass both
self.e2eeOptions = e2eeOptions
self.encryptionOptions = encryptionOptions
self.reportRemoteTrackStatistics = reportRemoteTrackStatistics

super.init()

if e2eeOptions != nil, encryptionOptions != nil {
log("Specifying both 'e2eeOptions' and 'encryptionOptions' is not supported. Migrate to 'EncryptionOptions' to enable data channel encryption (requires support from all platforms).", .error)
}
}

// MARK: - Equal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ class EncryptedDataChannelTests: LKTestCase, @unchecked Sendable {
await self.fulfillment(of: [self.decryptionErrorExpectation], timeout: 5)

XCTAssertNotNil(self.lastDecryptionError, "Decryption error should have occurred")
XCTAssertNil(self.receivedData, "No data should be received when decryption fails")
XCTAssert(self.receivedData.isEmpty, "No data should be received when decryption fails")
}
}

Expand Down Expand Up @@ -188,7 +188,7 @@ class EncryptedDataChannelTests: LKTestCase, @unchecked Sendable {
await self.fulfillment(of: [self.decryptionErrorExpectation], timeout: 5)

XCTAssertNotNil(self.lastDecryptionError, "Decryption error should have occurred with mismatched per-participant keys")
XCTAssertNil(self.receivedData, "No data should be received when per-participant key decryption fails")
XCTAssert(self.receivedData.isEmpty, "No data should be received when per-participant key decryption fails")
}
}

Expand Down
Loading