@capgo/camera-preview 7.4.0-beta.21 → 7.4.0-beta.22
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.
- package/android/.gradle/8.14.2/executionHistory/executionHistory.bin +0 -0
- package/android/.gradle/8.14.2/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/8.14.2/fileHashes/fileHashes.bin +0 -0
- package/android/.gradle/8.14.2/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/8.14.2/fileHashes/resourceHashesCache.bin +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/file-system.probe +0 -0
- package/android/src/main/java/com/ahm/capacitor/camera/preview/CameraPreview.java +111 -33
- package/android/src/main/java/com/ahm/capacitor/camera/preview/CameraXView.java +79 -38
- package/android/src/main/java/com/ahm/capacitor/camera/preview/GridOverlayView.java +8 -1
- package/dist/docs.json +2 -2
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/web.js +7 -3
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +7 -3
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +7 -3
- package/dist/plugin.js.map +1 -1
- package/ios/Sources/CapgoCameraPreview/CameraController.swift +28 -28
- package/ios/Sources/CapgoCameraPreview/Plugin.swift +10 -10
- package/package.json +1 -1
|
@@ -436,7 +436,7 @@ public class CameraPreview: CAPPlugin, CAPBridgedPlugin, CLLocationManagerDelega
|
|
|
436
436
|
self.disableAudio = call.getBool("disableAudio") ?? true
|
|
437
437
|
self.aspectRatio = call.getString("aspectRatio")
|
|
438
438
|
self.gridMode = call.getString("gridMode") ?? "none"
|
|
439
|
-
self.positioning = call.getString("positioning") ?? "
|
|
439
|
+
self.positioning = call.getString("positioning") ?? "top"
|
|
440
440
|
let initialZoomLevel = call.getFloat("initialZoomLevel") ?? 1.0
|
|
441
441
|
if self.aspectRatio != nil && (call.getInt("width") != nil || call.getInt("height") != nil) {
|
|
442
442
|
call.reject("Cannot set both aspectRatio and size (width/height). Use setPreviewSize after start.")
|
|
@@ -473,7 +473,7 @@ public class CameraPreview: CAPPlugin, CAPBridgedPlugin, CLLocationManagerDelega
|
|
|
473
473
|
private func completeStartCamera(call: CAPPluginCall) {
|
|
474
474
|
// Create and configure the preview view first
|
|
475
475
|
self.updateCameraFrame()
|
|
476
|
-
|
|
476
|
+
|
|
477
477
|
print("[CameraPreview] completeStartCamera - Preview frame after updateCameraFrame: \(self.previewView.frame)")
|
|
478
478
|
|
|
479
479
|
// Make webview transparent - comprehensive approach
|
|
@@ -509,7 +509,7 @@ public class CameraPreview: CAPPlugin, CAPBridgedPlugin, CLLocationManagerDelega
|
|
|
509
509
|
// Set up callback to wait for first frame before resolving
|
|
510
510
|
self.cameraController.firstFrameReadyCallback = { [weak self] in
|
|
511
511
|
guard let self = self else { return }
|
|
512
|
-
|
|
512
|
+
|
|
513
513
|
DispatchQueue.main.async {
|
|
514
514
|
var returnedObject = JSObject()
|
|
515
515
|
returnedObject["width"] = self.previewView.frame.width as any JSValue
|
|
@@ -519,7 +519,7 @@ public class CameraPreview: CAPPlugin, CAPBridgedPlugin, CLLocationManagerDelega
|
|
|
519
519
|
call.resolve(returnedObject)
|
|
520
520
|
}
|
|
521
521
|
}
|
|
522
|
-
|
|
522
|
+
|
|
523
523
|
// If already received first frame (unlikely but possible), resolve immediately
|
|
524
524
|
if self.cameraController.hasReceivedFirstFrame {
|
|
525
525
|
var returnedObject = JSObject()
|
|
@@ -687,7 +687,7 @@ public class CameraPreview: CAPPlugin, CAPBridgedPlugin, CLLocationManagerDelega
|
|
|
687
687
|
let width = call.getInt("width")
|
|
688
688
|
let height = call.getInt("height")
|
|
689
689
|
let aspectRatio = call.getString("aspectRatio")
|
|
690
|
-
|
|
690
|
+
|
|
691
691
|
print("[CameraPreview] Raw parameter values - width: \(String(describing: width)), height: \(String(describing: height)), aspectRatio: \(String(describing: aspectRatio))")
|
|
692
692
|
|
|
693
693
|
// Check for conflicting parameters
|
|
@@ -701,11 +701,11 @@ public class CameraPreview: CAPPlugin, CAPBridgedPlugin, CLLocationManagerDelega
|
|
|
701
701
|
// Don't pass aspectRatio in this case - let the capture method handle preview matching
|
|
702
702
|
print("[CameraPreview] Capture decision - width: \(width == nil), height: \(height == nil), aspectRatio param: \(aspectRatio == nil)")
|
|
703
703
|
print("[CameraPreview] Stored aspectRatio: \(self.aspectRatio ?? "nil")")
|
|
704
|
-
|
|
704
|
+
|
|
705
705
|
// Only pass aspectRatio if explicitly provided in the capture call
|
|
706
706
|
// Never use the stored aspectRatio when capturing without dimensions
|
|
707
707
|
let captureAspectRatio: String? = aspectRatio
|
|
708
|
-
|
|
708
|
+
|
|
709
709
|
print("[CameraPreview] Capture params - quality: \(quality), saveToGallery: \(saveToGallery), withExifLocation: \(withExifLocation), width: \(width ?? -1), height: \(height ?? -1), aspectRatio: \(aspectRatio ?? "nil"), using aspectRatio: \(captureAspectRatio ?? "nil")")
|
|
710
710
|
print("[CameraPreview] Current location: \(self.currentLocation?.description ?? "nil")")
|
|
711
711
|
print("[CameraPreview] Preview dimensions: \(self.previewView.frame.width)x\(self.previewView.frame.height)")
|
|
@@ -1354,9 +1354,9 @@ public class CameraPreview: CAPPlugin, CAPBridgedPlugin, CLLocationManagerDelega
|
|
|
1354
1354
|
// Handle auto-centering when position is -1
|
|
1355
1355
|
if currentX == -1 || currentY == -1 {
|
|
1356
1356
|
// Only override dimensions if aspect ratio is provided and no explicit dimensions given
|
|
1357
|
-
if let ratio = currentAspectRatio,
|
|
1358
|
-
currentWidth == UIScreen.main.bounds.size.width &&
|
|
1359
|
-
|
|
1357
|
+
if let ratio = currentAspectRatio,
|
|
1358
|
+
currentWidth == UIScreen.main.bounds.size.width &&
|
|
1359
|
+
currentHeight == UIScreen.main.bounds.size.height {
|
|
1360
1360
|
finalWidth = webViewWidth
|
|
1361
1361
|
|
|
1362
1362
|
// Calculate height based on aspect ratio
|