capacitor-community-multilens-camerapreview 7.1.2 → 7.1.4

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.
@@ -291,10 +291,11 @@ extension CameraController {
291
291
 
292
292
  captureSession.commitConfiguration()
293
293
 
294
- // Restart the capture session
295
294
  captureSession.startRunning()
296
295
 
297
- updateVideoOrientation()
296
+ DispatchQueue.main.async {
297
+ self.updateVideoOrientation()
298
+ }
298
299
  }
299
300
  func setCameraLens(lens: String) throws {
300
301
  guard let captureSession = self.captureSession, captureSession.isRunning else {
@@ -331,6 +332,8 @@ extension CameraController {
331
332
  throw CameraControllerError.noCamerasAvailable
332
333
  }
333
334
 
335
+ self.rearCamera = camera
336
+
334
337
  self.rearCameraInput = try AVCaptureDeviceInput(device: camera)
335
338
  if captureSession.canAddInput(self.rearCameraInput!) {
336
339
  captureSession.addInput(self.rearCameraInput!)
@@ -342,7 +345,9 @@ extension CameraController {
342
345
  captureSession.commitConfiguration()
343
346
  captureSession.startRunning()
344
347
 
345
- updateVideoOrientation()
348
+ DispatchQueue.main.async {
349
+ self.updateVideoOrientation()
350
+ }
346
351
  }
347
352
 
348
353
  func setZoom(zoomFactor: CGFloat) throws {
@@ -368,7 +373,9 @@ extension CameraController {
368
373
  throw CameraControllerError.invalidOperation
369
374
  }
370
375
 
371
- updateVideoOrientation()
376
+ DispatchQueue.main.async {
377
+ self.updateVideoOrientation()
378
+ }
372
379
  }
373
380
 
374
381
  func captureImage(completion: @escaping (UIImage?, Error?) -> Void) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "capacitor-community-multilens-camerapreview",
3
- "version": "7.1.2",
3
+ "version": "7.1.4",
4
4
  "description": "fork of capacitor community camera preview with support for switchting lenses",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",