Skip to content

Commit

Permalink
Fall back for multi-cam unsupported devices
Browse files Browse the repository at this point in the history
  • Loading branch information
hiroshihorie committed Aug 13, 2024
1 parent 3d151c5 commit 7fdbb0c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Sources/LiveKit/Track/Capturers/CameraCapturer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,17 @@ public class CameraCapturer: VideoCapturer {
private lazy var adapter: VideoCapturerDelegateAdapter = .init(cameraCapturer: self)

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

public var captureSession: AVCaptureSession {
#if os(iOS)
Self._multiCamSession
if AVCaptureMultiCamSession.isMultiCamSupported {
Self._multiCamSession
} else {
AVCaptureSession()
}
#else
AVCaptureSession()
#endif
Expand Down

0 comments on commit 7fdbb0c

Please sign in to comment.