diff --git a/Sources/LiveKit/E2EE/E2EEManager.swift b/Sources/LiveKit/E2EE/E2EEManager.swift index 72b7880ba..3941677a1 100644 --- a/Sources/LiveKit/E2EE/E2EEManager.swift +++ b/Sources/LiveKit/E2EE/E2EEManager.swift @@ -113,13 +113,12 @@ public class E2EEManager: NSObject, ObservableObject, Loggable { return } - guard let frameCryptor = DispatchQueue.liveKitWebRTC.sync(execute: { - LKRTCFrameCryptor(factory: RTC.peerConnectionFactory, - rtpSender: sender, - participantId: participantIdentity.stringValue, - algorithm: .aesGcm, - keyProvider: e2eeOptions.keyProvider.rtcKeyProvider) - }) else { + guard let frameCryptor = LKRTCFrameCryptor(factory: RTC.peerConnectionFactory, + rtpSender: sender, + participantId: participantIdentity.stringValue, + algorithm: .aesGcm, + keyProvider: e2eeOptions.keyProvider.rtcKeyProvider) + else { log("frameCryptor is nil, skipping creating frame cryptor...", .warning) return } @@ -144,13 +143,12 @@ public class E2EEManager: NSObject, ObservableObject, Loggable { return } - guard let frameCryptor = DispatchQueue.liveKitWebRTC.sync(execute: { - LKRTCFrameCryptor(factory: RTC.peerConnectionFactory, - rtpReceiver: receiver, - participantId: participantIdentity.stringValue, - algorithm: .aesGcm, - keyProvider: e2eeOptions.keyProvider.rtcKeyProvider) - }) else { + guard let frameCryptor = LKRTCFrameCryptor(factory: RTC.peerConnectionFactory, + rtpReceiver: receiver, + participantId: participantIdentity.stringValue, + algorithm: .aesGcm, + keyProvider: e2eeOptions.keyProvider.rtcKeyProvider) + else { log("frameCryptor is nil, skipping creating frame cryptor...", .warning) return }