Skip to content

Commit 7fdbb0c

Browse files
committed
Fall back for multi-cam unsupported devices
1 parent 3d151c5 commit 7fdbb0c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Sources/LiveKit/Track/Capturers/CameraCapturer.swift

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,17 @@ public class CameraCapturer: VideoCapturer {
9090
private lazy var adapter: VideoCapturerDelegateAdapter = .init(cameraCapturer: self)
9191

9292
#if os(iOS)
93+
// static let is lazy by default and AVCaptureMultiCamSession will only be initialized if used.
9394
private static let _multiCamSession = AVCaptureMultiCamSession()
9495
#endif
9596

9697
public var captureSession: AVCaptureSession {
9798
#if os(iOS)
98-
Self._multiCamSession
99+
if AVCaptureMultiCamSession.isMultiCamSupported {
100+
Self._multiCamSession
101+
} else {
102+
AVCaptureSession()
103+
}
99104
#else
100105
AVCaptureSession()
101106
#endif

0 commit comments

Comments
 (0)