File tree 1 file changed +16
-0
lines changed
1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -95,6 +95,22 @@ - (void)toggleTorch
95
95
- (void )initCapture
96
96
{
97
97
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
+
98
114
AVCaptureDeviceInput *captureInput = [AVCaptureDeviceInput deviceInputWithDevice: self .device error: nil ];
99
115
AVCaptureVideoDataOutput *captureOutput = [[AVCaptureVideoDataOutput alloc ] init ];
100
116
captureOutput.alwaysDiscardsLateVideoFrames = YES ;
You can’t perform that action at this time.
0 commit comments