File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -95,6 +95,22 @@ - (void)toggleTorch
9595- (void )initCapture
9696{
9797 self.device = [AVCaptureDevice defaultDeviceWithMediaType: AVMediaTypeVideo];
98+
99+ if (@available (iOS 13.0 , *)) {
100+ AVCaptureDeviceDiscoverySession *captureDeviceDiscoverySession = [AVCaptureDeviceDiscoverySession discoverySessionWithDeviceTypes: @[AVCaptureDeviceTypeBuiltInUltraWideCamera]
101+ mediaType: AVMediaTypeVideo
102+ position: AVCaptureDevicePositionBack];
103+
104+ NSArray *captureDevices = [captureDeviceDiscoverySession devices ];
105+
106+ if (captureDevices.count > 0 ) {
107+ NSLog (@" Supports ultrawide camera" );
108+
109+ self.device = captureDevices[0 ];
110+ }
111+ }
112+
113+
98114 AVCaptureDeviceInput *captureInput = [AVCaptureDeviceInput deviceInputWithDevice: self .device error: nil ];
99115 AVCaptureVideoDataOutput *captureOutput = [[AVCaptureVideoDataOutput alloc ] init ];
100116 captureOutput.alwaysDiscardsLateVideoFrames = YES ;
You can’t perform that action at this time.
0 commit comments