Skip to content

Commit

Permalink
Merge pull request #569 from teslamotors/fix/iphone-12-zoom
Browse files Browse the repository at this point in the history
Added multi-lens zoom support for iPhone 12, 13, and 14
  • Loading branch information
scarlac committed Aug 10, 2023
2 parents 995943f + 33b3f98 commit ccf4c04
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions ios/ReactNativeCameraKit/RealCamera.swift
Original file line number Diff line number Diff line change
Expand Up @@ -429,14 +429,17 @@ class RealCamera: NSObject, CameraProtocol, AVCaptureMetadataOutputObjectsDelega
private func getBestDevice(for cameraType: CameraType) -> AVCaptureDevice? {
if #available(iOS 13.0, *) {
if let device = AVCaptureDevice.default(.builtInTripleCamera, for: .video, position: cameraType.avPosition) {
return device
return device // multi-lens/logical device, ultra-wide & wide & tele
}
if let device = AVCaptureDevice.default(.builtInDualWideCamera, for: .video, position: cameraType.avPosition) {
return device // multi-lens/logical device, ultra-wide & wide
}
}
if let device = AVCaptureDevice.default(.builtInDualCamera, for: .video, position: cameraType.avPosition) {
return device
return device // multi-lens/logical device, wide & tele (no ultra-wide)
}
if let device = AVCaptureDevice.default(.builtInWideAngleCamera, for: .video, position: cameraType.avPosition) {
return device
return device // single-lens/physical device
}
return nil
}
Expand Down

0 comments on commit ccf4c04

Please sign in to comment.