@capgo/camera-preview 8.11.8 → 8.11.9
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/README.md
CHANGED
|
@@ -1,12 +1,28 @@
|
|
|
1
1
|
# Capacitor Camera Preview Plugin
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Show a live camera preview inside your Capacitor app, behind or around your own UI, and capture photos, frames and video. Build custom camera screens, scanners and AR-style overlays.
|
|
4
|
+
|
|
5
|
+
<a href="https://capgo.app/?ref=plugin_camera_preview"><img src="https://capgo.app/readme-banner.svg?repo=Cap-go/capacitor-camera-preview" alt="Capgo - Instant updates for Capacitor" /></a>
|
|
4
6
|
|
|
5
7
|
<div align="center">
|
|
6
|
-
<
|
|
7
|
-
<h2><a href="https://capgo.app/
|
|
8
|
+
<p><b>Capgo</b>: open-source live updates for Ionic and Capacitor apps. Ship OTA fixes and features instantly, without waiting for app store review.</p>
|
|
9
|
+
<h2><a href="https://capgo.app/register/?ref=plugin_camera_preview">➡️ Get started for free</a></h2>
|
|
10
|
+
<p>14-day unlimited free trial. No credit card required</p>
|
|
11
|
+
<p><a href="https://capgo.app/consulting/?ref=plugin_camera_preview">Missing a feature? We'll build the plugin for you 💪</a></p>
|
|
8
12
|
</div>
|
|
9
13
|
|
|
14
|
+
<p align="center">
|
|
15
|
+
<img src="https://raw.githubusercontent.com/Cap-go/capacitor-camera-preview/main/assets/github-social-preview.png" alt="@capgo/camera-preview for Capacitor apps" width="300" />
|
|
16
|
+
</p>
|
|
17
|
+
|
|
18
|
+
## Key features
|
|
19
|
+
|
|
20
|
+
- **Live preview**: `start()` and `stop()` with position, size, opacity and aspect ratio control.
|
|
21
|
+
- **Capture**: `capture()` for full photos and `captureSample()` for quick frames from the stream.
|
|
22
|
+
- **Video**: `startRecordVideo()` and `stopRecordVideo()` with quality, codec, frame rate and stabilization settings.
|
|
23
|
+
- **Camera controls**: flash, zoom, focus, exposure, white balance, `flip()` and `setDeviceId()` to pick a lens.
|
|
24
|
+
- **Barcode scanning**: `startBarcodeScanner()` with `barcodeScanned` events while the preview keeps running.
|
|
25
|
+
- **Platforms**: iOS, Android and Web. iOS uses AVFoundation, Android uses CameraX. Web supports a subset (preview, capture and basic controls).
|
|
10
26
|
|
|
11
27
|

|
|
12
28
|

|
|
@@ -103,7 +119,7 @@ use https://capacitorjs.com/docs/apis/filesystem#deletefile for that
|
|
|
103
119
|
|
|
104
120
|
- Native tap‑to‑focus and pinch‑to‑zoom gesture handling are intentionally disabled on both Android and iOS.
|
|
105
121
|
- Handle all user interactions in your HTML/JS layer, then call the plugin methods:
|
|
106
|
-
- Focus: `await CameraPreview.setFocus({ x, y })` with normalized coordinates (0
|
|
122
|
+
- Focus: `await CameraPreview.setFocus({ x, y })` with normalized coordinates (0 to 1) relative to the preview bounds.
|
|
107
123
|
- Zoom: `await CameraPreview.setZoom({ level })` using your own gesture/UI logic.
|
|
108
124
|
- Rationale: native gesture recognizers can conflict with your HTML touch handlers and block UI interactions. Keeping gestures in JS guarantees your UI receives touches as intended.
|
|
109
125
|
- The `enableZoom` start option is removed. Use JS gestures + `setZoom(...)`.
|
|
@@ -35,7 +35,7 @@ extension UIWindow {
|
|
|
35
35
|
*/
|
|
36
36
|
@objc(CameraPreview)
|
|
37
37
|
public class CameraPreview: CAPPlugin, CAPBridgedPlugin, CLLocationManagerDelegate {
|
|
38
|
-
private let pluginVersion: String = "8.11.
|
|
38
|
+
private let pluginVersion: String = "8.11.9"
|
|
39
39
|
public let identifier = "CameraPreviewPlugin"
|
|
40
40
|
public let jsName = "CameraPreview"
|
|
41
41
|
public let pluginMethods: [CAPPluginMethod] = [
|