capacitor-camera-module 0.0.60 → 0.0.61
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -196,9 +196,13 @@ public class CameraModulePlugin: CAPPlugin,CAPBridgedPlugin,AVCaptureVideoDataOu
|
|
|
196
196
|
previewView.layer.zPosition = 0
|
|
197
197
|
|
|
198
198
|
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
let safeArea = container.safeAreaLayoutGuide
|
|
202
|
+
|
|
199
203
|
NSLayoutConstraint.activate([
|
|
200
204
|
previewView.topAnchor.constraint(equalTo: container.topAnchor),
|
|
201
|
-
previewView.bottomAnchor.constraint(equalTo:
|
|
205
|
+
previewView.bottomAnchor.constraint(equalTo: safeArea.bottomAnchor, constant: -180),
|
|
202
206
|
previewView.leadingAnchor.constraint(equalTo: container.leadingAnchor),
|
|
203
207
|
previewView.trailingAnchor.constraint(equalTo: container.trailingAnchor)
|
|
204
208
|
])
|
|
@@ -210,6 +214,8 @@ public class CameraModulePlugin: CAPPlugin,CAPBridgedPlugin,AVCaptureVideoDataOu
|
|
|
210
214
|
|
|
211
215
|
previewView.layoutIfNeeded()
|
|
212
216
|
previewLayer.frame = previewView.bounds
|
|
217
|
+
previewLayer.masksToBounds = true
|
|
218
|
+
|
|
213
219
|
|
|
214
220
|
previewView.layer.insertSublayer(previewLayer, at: 0)
|
|
215
221
|
|
|
@@ -219,7 +225,12 @@ public class CameraModulePlugin: CAPPlugin,CAPBridgedPlugin,AVCaptureVideoDataOu
|
|
|
219
225
|
self.videoPreviewLayer = previewLayer
|
|
220
226
|
self.captureSession = session
|
|
221
227
|
|
|
228
|
+
session.beginConfiguration()
|
|
229
|
+
session.sessionPreset = .photo
|
|
230
|
+
session.commitConfiguration()
|
|
231
|
+
|
|
222
232
|
DispatchQueue.global(qos: .userInitiated).async {
|
|
233
|
+
|
|
223
234
|
session.startRunning()
|
|
224
235
|
}
|
|
225
236
|
call.resolve()
|
|
@@ -233,7 +244,10 @@ public class CameraModulePlugin: CAPPlugin,CAPBridgedPlugin,AVCaptureVideoDataOu
|
|
|
233
244
|
self.captureSession = nil
|
|
234
245
|
self.videoPreviewLayer?.removeFromSuperlayer()
|
|
235
246
|
self.previewView?.removeFromSuperview()
|
|
247
|
+
self.videoPreviewLayer?.session = nil
|
|
248
|
+
|
|
236
249
|
self.videoPreviewLayer = nil
|
|
250
|
+
|
|
237
251
|
self.previewView = nil
|
|
238
252
|
call.resolve()
|
|
239
253
|
}
|