capacitor-camera-view 2.0.2 → 2.2.0-rc.1
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 +215 -19
- package/android/build.gradle +9 -5
- package/android/src/main/AndroidManifest.xml +1 -0
- package/android/src/main/java/com/michaelwolz/capacitorcameraview/CameraView.kt +491 -116
- package/android/src/main/java/com/michaelwolz/capacitorcameraview/CameraViewPlugin.kt +181 -31
- package/android/src/main/java/com/michaelwolz/capacitorcameraview/model/CameraResult.kt +47 -0
- package/android/src/main/java/com/michaelwolz/capacitorcameraview/model/CameraSessionConfiguration.kt +11 -1
- package/android/src/main/java/com/michaelwolz/capacitorcameraview/model/VideoRecordingQuality.kt +10 -0
- package/android/src/main/java/com/michaelwolz/capacitorcameraview/utils.kt +114 -5
- package/dist/docs.json +281 -8
- package/dist/esm/definitions.d.ts +128 -6
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/web.d.ts +26 -4
- package/dist/esm/web.js +218 -18
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +219 -18
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +219 -18
- package/dist/plugin.js.map +1 -1
- package/ios/Sources/CameraViewPlugin/CameraError.swift +125 -2
- package/ios/Sources/CameraViewPlugin/CameraEvents.swift +109 -0
- package/ios/Sources/CameraViewPlugin/CameraSessionConfiguration.swift +28 -1
- package/ios/Sources/CameraViewPlugin/CameraViewManager+BarcodeScan.swift +30 -41
- package/ios/Sources/CameraViewPlugin/CameraViewManager+PhotoCapture.swift +38 -7
- package/ios/Sources/CameraViewPlugin/CameraViewManager+VideoDataOutput.swift +4 -3
- package/ios/Sources/CameraViewPlugin/CameraViewManager+VideoRecording.swift +302 -0
- package/ios/Sources/CameraViewPlugin/CameraViewManager.swift +246 -166
- package/ios/Sources/CameraViewPlugin/CameraViewPlugin.swift +194 -96
- package/ios/Sources/CameraViewPlugin/TempFileManager.swift +215 -0
- package/ios/Sources/CameraViewPlugin/Utils.swift +102 -0
- package/package.json +17 -17
package/README.md
CHANGED
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
|
|
30
30
|
- 📹 Embed a **live camera feed** directly into your app.
|
|
31
31
|
- 📸 Capture photos or frames from the camera preview.
|
|
32
|
+
- 🎥 **Video recording** with optional audio support.
|
|
32
33
|
- 🔍 **Barcode detection** support.
|
|
33
34
|
- 📱 **Virtual device support** for automatic lens selection based on zoom level and focus (iOS only).
|
|
34
35
|
- 🔦 Control **zoom**, **flash** and **torch** modes programmatically.
|
|
@@ -62,12 +63,70 @@ Add the following keys to your app's `Info.plist` file:
|
|
|
62
63
|
<string>To capture photos and videos</string>
|
|
63
64
|
```
|
|
64
65
|
|
|
66
|
+
If you plan to use `startRecording` with `enableAudio: true`, also add:
|
|
67
|
+
|
|
68
|
+
```xml
|
|
69
|
+
<key>NSMicrophoneUsageDescription</key>
|
|
70
|
+
<string>To record audio with video</string>
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
> [!IMPORTANT]
|
|
74
|
+
> The `NSMicrophoneUsageDescription` key must be present in `Info.plist` **before** microphone permission is ever requested — even if the request happens automatically when starting a recording with audio. Omitting it will cause your app to crash at runtime.
|
|
75
|
+
|
|
65
76
|
#### Android
|
|
66
77
|
|
|
67
|
-
The `CAMERA` permission is
|
|
78
|
+
The `CAMERA` permission is added to your app's `AndroidManifest.xml` automatically by the plugin. If you plan to use `startRecording` with `enableAudio: true`, the `RECORD_AUDIO` permission is also declared automatically by the plugin. You can verify these in your merged manifest:
|
|
68
79
|
|
|
69
80
|
```xml
|
|
70
81
|
<uses-permission android:name="android.permission.CAMERA" />
|
|
82
|
+
<uses-permission android:name="android.permission.RECORD_AUDIO" />
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
> [!IMPORTANT]
|
|
86
|
+
> Declaring a permission in `AndroidManifest.xml` is required for the system to allow requesting it at runtime. The plugin handles this for you, but make sure you are not accidentally stripping the permission in your build configuration.
|
|
87
|
+
|
|
88
|
+
## 🔒 Permissions
|
|
89
|
+
|
|
90
|
+
The plugin handles permissions for you automatically when a feature that requires them is used. However, you can also request permissions explicitly in advance.
|
|
91
|
+
|
|
92
|
+
### Requesting permissions explicitly
|
|
93
|
+
|
|
94
|
+
By default, `requestPermissions()` only requests **camera** permission, preserving backward compatibility:
|
|
95
|
+
|
|
96
|
+
```typescript
|
|
97
|
+
// Request camera permission only (default behavior)
|
|
98
|
+
const status = await CameraView.requestPermissions();
|
|
99
|
+
console.log(status.camera); // 'granted' | 'denied' | 'prompt'
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
To also request **microphone** permission (needed for video recording with audio), pass the `permissions` option:
|
|
103
|
+
|
|
104
|
+
```typescript
|
|
105
|
+
// Request both camera and microphone permissions
|
|
106
|
+
const status = await CameraView.requestPermissions({
|
|
107
|
+
permissions: ['camera', 'microphone'],
|
|
108
|
+
});
|
|
109
|
+
console.log(status.camera); // 'granted' | 'denied' | 'prompt'
|
|
110
|
+
console.log(status.microphone); // 'granted' | 'denied' | 'prompt'
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### Automatic permission requests
|
|
114
|
+
|
|
115
|
+
You do not need to call `requestPermissions()` manually. The plugin will automatically request the required permissions when a feature is first used:
|
|
116
|
+
|
|
117
|
+
- **Camera** permission is requested automatically when `start()` is called.
|
|
118
|
+
- **Microphone** permission is requested automatically when `startRecording({ enableAudio: true })` is called.
|
|
119
|
+
|
|
120
|
+
Regardless of whether you request permissions manually or rely on the automatic flow, the corresponding entries **must** be declared in your app's platform configuration (`Info.plist` on iOS, `AndroidManifest.xml` on Android) as described above.
|
|
121
|
+
|
|
122
|
+
### Checking permission status
|
|
123
|
+
|
|
124
|
+
Use `checkPermissions()` to query the current permission state without triggering a system prompt:
|
|
125
|
+
|
|
126
|
+
```typescript
|
|
127
|
+
const status = await CameraView.checkPermissions();
|
|
128
|
+
console.log(status.camera); // 'granted' | 'denied' | 'prompt'
|
|
129
|
+
console.log(status.microphone); // 'granted' | 'denied' | 'prompt'
|
|
71
130
|
```
|
|
72
131
|
|
|
73
132
|
## ▶️ Basic Usage
|
|
@@ -174,6 +233,54 @@ CameraView.addListener('barcodeDetected', (data) => {
|
|
|
174
233
|
|
|
175
234
|
See the [`BarcodeDetectionData`](#barcodedetectiondata) interface for details on the event payload.
|
|
176
235
|
|
|
236
|
+
## 🎥 Video Recording
|
|
237
|
+
|
|
238
|
+
This plugin supports recording video directly from the live camera feed.
|
|
239
|
+
|
|
240
|
+
**How it works:**
|
|
241
|
+
* **iOS:** Uses `AVCaptureMovieFileOutput` on top of the existing `AVCaptureSession`. Output is saved as `.mp4`.
|
|
242
|
+
* **Android:** Uses the CameraX `VideoCapture` use case via `LifecycleCameraController`. Output is saved as `.mp4`.
|
|
243
|
+
* **Web:** Uses the browser `MediaRecorder` API on the existing `MediaStream`. Output is a `.webm` blob URL (MP4 is not broadly supported by browsers).
|
|
244
|
+
|
|
245
|
+
**Basic usage:**
|
|
246
|
+
|
|
247
|
+
```typescript
|
|
248
|
+
import { CameraView } from 'capacitor-camera-view';
|
|
249
|
+
|
|
250
|
+
// Start recording (camera must already be running)
|
|
251
|
+
await CameraView.startRecording({ enableAudio: false });
|
|
252
|
+
|
|
253
|
+
// Stop recording and get the result
|
|
254
|
+
const result = await CameraView.stopRecording();
|
|
255
|
+
console.log('Video saved to:', result.webPath);
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
**Playing back the recorded video:**
|
|
259
|
+
|
|
260
|
+
```html
|
|
261
|
+
<video [src]="videoPath" controls></video>
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
**Recording with audio:**
|
|
265
|
+
|
|
266
|
+
```typescript
|
|
267
|
+
await CameraView.startRecording({ enableAudio: true });
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
**Recording with explicit quality preset (native):**
|
|
271
|
+
|
|
272
|
+
```typescript
|
|
273
|
+
await CameraView.startRecording({
|
|
274
|
+
enableAudio: true,
|
|
275
|
+
videoQuality: 'fhd', // lowest | sd | hd | fhd | uhd | highest
|
|
276
|
+
});
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
> [!NOTE]
|
|
280
|
+
> When `enableAudio: true` is used, the plugin automatically requests microphone permission from the user if it has not been granted yet. The permission declaration must still be present in your platform configuration — see the [Permissions](#-permissions) section for details.
|
|
281
|
+
|
|
282
|
+
See the [`VideoRecordingOptions`](#videorecordingoptions) and [`VideoRecordingResponse`](#videorecordingresponse) interfaces in the API section for the full set of options.
|
|
283
|
+
|
|
177
284
|
## 🧪 Example App
|
|
178
285
|
|
|
179
286
|
To see the plugin in action, check out the example app in the `example-app` folder. The app demonstrates how to integrate and use the Capacitor Camera View plugin in an Ionic Angular project.
|
|
@@ -206,6 +313,8 @@ chore: update dependencies
|
|
|
206
313
|
* [`isRunning()`](#isrunning)
|
|
207
314
|
* [`capture(...)`](#capture)
|
|
208
315
|
* [`captureSample(...)`](#capturesample)
|
|
316
|
+
* [`startRecording(...)`](#startrecording)
|
|
317
|
+
* [`stopRecording()`](#stoprecording)
|
|
209
318
|
* [`flipCamera()`](#flipcamera)
|
|
210
319
|
* [`getAvailableDevices()`](#getavailabledevices)
|
|
211
320
|
* [`getZoom()`](#getzoom)
|
|
@@ -217,7 +326,7 @@ chore: update dependencies
|
|
|
217
326
|
* [`getTorchMode()`](#gettorchmode)
|
|
218
327
|
* [`setTorchMode(...)`](#settorchmode)
|
|
219
328
|
* [`checkPermissions()`](#checkpermissions)
|
|
220
|
-
* [`requestPermissions()`](#requestpermissions)
|
|
329
|
+
* [`requestPermissions(...)`](#requestpermissions)
|
|
221
330
|
* [`addListener('barcodeDetected', ...)`](#addlistenerbarcodedetected-)
|
|
222
331
|
* [`removeAllListeners(...)`](#removealllisteners)
|
|
223
332
|
* [Interfaces](#interfaces)
|
|
@@ -321,6 +430,40 @@ not yet well supported on the web.
|
|
|
321
430
|
--------------------
|
|
322
431
|
|
|
323
432
|
|
|
433
|
+
### startRecording(...)
|
|
434
|
+
|
|
435
|
+
```typescript
|
|
436
|
+
startRecording(options?: VideoRecordingOptions | undefined) => Promise<void>
|
|
437
|
+
```
|
|
438
|
+
|
|
439
|
+
Start recording video from the current camera.
|
|
440
|
+
Camera must be running. Throws if already recording.
|
|
441
|
+
|
|
442
|
+
| Param | Type | Description |
|
|
443
|
+
| ------------- | ----------------------------------------------------------------------- | ---------------------------------- |
|
|
444
|
+
| **`options`** | <code><a href="#videorecordingoptions">VideoRecordingOptions</a></code> | - Optional recording configuration |
|
|
445
|
+
|
|
446
|
+
**Since:** 2.2.0
|
|
447
|
+
|
|
448
|
+
--------------------
|
|
449
|
+
|
|
450
|
+
|
|
451
|
+
### stopRecording()
|
|
452
|
+
|
|
453
|
+
```typescript
|
|
454
|
+
stopRecording() => Promise<VideoRecordingResponse>
|
|
455
|
+
```
|
|
456
|
+
|
|
457
|
+
Stop the current video recording and return the result.
|
|
458
|
+
Throws if no recording is in progress.
|
|
459
|
+
|
|
460
|
+
**Returns:** <code>Promise<<a href="#videorecordingresponse">VideoRecordingResponse</a>></code>
|
|
461
|
+
|
|
462
|
+
**Since:** 2.2.0
|
|
463
|
+
|
|
464
|
+
--------------------
|
|
465
|
+
|
|
466
|
+
|
|
324
467
|
### flipCamera()
|
|
325
468
|
|
|
326
469
|
```typescript
|
|
@@ -481,7 +624,7 @@ Set the torch (flashlight) mode and intensity.
|
|
|
481
624
|
checkPermissions() => Promise<PermissionStatus>
|
|
482
625
|
```
|
|
483
626
|
|
|
484
|
-
Check camera permission status without requesting permissions.
|
|
627
|
+
Check camera and microphone permission status without requesting permissions.
|
|
485
628
|
|
|
486
629
|
**Returns:** <code>Promise<<a href="#permissionstatus">PermissionStatus</a>></code>
|
|
487
630
|
|
|
@@ -490,13 +633,20 @@ Check camera permission status without requesting permissions.
|
|
|
490
633
|
--------------------
|
|
491
634
|
|
|
492
635
|
|
|
493
|
-
### requestPermissions()
|
|
636
|
+
### requestPermissions(...)
|
|
494
637
|
|
|
495
638
|
```typescript
|
|
496
|
-
requestPermissions() => Promise<PermissionStatus>
|
|
639
|
+
requestPermissions(options?: { permissions?: CameraPermissionType[] | undefined; } | undefined) => Promise<PermissionStatus>
|
|
497
640
|
```
|
|
498
641
|
|
|
499
|
-
Request camera
|
|
642
|
+
Request camera and/or microphone permissions from the user.
|
|
643
|
+
|
|
644
|
+
By default, only camera permission is requested. To also request microphone
|
|
645
|
+
permission (needed for video recording with audio), pass `{ permissions: ['camera', 'microphone'] }`.
|
|
646
|
+
|
|
647
|
+
| Param | Type | Description |
|
|
648
|
+
| ------------- | ------------------------------------------------------ | --------------------------------------------------------- |
|
|
649
|
+
| **`options`** | <code>{ permissions?: CameraPermissionType[]; }</code> | - Optional object specifying which permissions to request |
|
|
500
650
|
|
|
501
651
|
**Returns:** <code>Promise<<a href="#permissionstatus">PermissionStatus</a>></code>
|
|
502
652
|
|
|
@@ -550,15 +700,16 @@ Remove all listeners for this plugin.
|
|
|
550
700
|
|
|
551
701
|
Configuration options for starting a camera session.
|
|
552
702
|
|
|
553
|
-
| Prop | Type | Description | Default |
|
|
554
|
-
| -------------------------------- | --------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------- |
|
|
555
|
-
| **`enableBarcodeDetection`** | <code>boolean</code> | Enables the barcode detection functionality | <code>false</code> |
|
|
556
|
-
| **`
|
|
557
|
-
| **`
|
|
558
|
-
| **`
|
|
559
|
-
| **`
|
|
560
|
-
| **`
|
|
561
|
-
| **`
|
|
703
|
+
| Prop | Type | Description | Default | Since |
|
|
704
|
+
| -------------------------------- | --------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------- | ----- |
|
|
705
|
+
| **`enableBarcodeDetection`** | <code>boolean</code> | Enables the barcode detection functionality | <code>false</code> | |
|
|
706
|
+
| **`barcodeTypes`** | <code>BarcodeType[]</code> | Specific barcode types to detect. If not provided, all supported types are detected. Specifying only the types you need can significantly improve performance and reduce battery consumption, especially on mobile devices. | <code>undefined - all supported types are detected</code> | 2.1.0 |
|
|
707
|
+
| **`position`** | <code><a href="#cameraposition">CameraPosition</a></code> | Position of the camera to use | <code>'back'</code> | |
|
|
708
|
+
| **`deviceId`** | <code>string</code> | Specific device ID of the camera to use If provided, takes precedence over position | | |
|
|
709
|
+
| **`useTripleCameraIfAvailable`** | <code>boolean</code> | Whether to use the triple camera if available (iPhone Pro models only) | <code>false</code> | |
|
|
710
|
+
| **`preferredCameraDeviceTypes`** | <code>CameraDeviceType[]</code> | Ordered list of preferred camera device types to use (iOS only). The system will attempt to use the first available camera type in the list. If position is also provided, the system will use the first available camera type that matches the position and is in the list. This will fallback to the default camera type if none of the preferred types are available. | <code>undefined - system will decide based on position/deviceId</code> | |
|
|
711
|
+
| **`zoomFactor`** | <code>number</code> | The initial zoom factor to use | <code>1.0</code> | |
|
|
712
|
+
| **`containerElementId`** | <code>string</code> | Optional HTML ID of the container element where the camera view should be rendered. If not provided, the camera view will be appended to the document body. Web only. | | |
|
|
562
713
|
|
|
563
714
|
|
|
564
715
|
#### IsRunningResponse
|
|
@@ -580,6 +731,25 @@ Configuration options for capturing photos and samples.
|
|
|
580
731
|
| **`saveToFile`** | <code>boolean</code> | If true, saves to a temporary file and returns the web path instead of base64. The web path can be used to set the src attribute of an image for efficient loading and rendering. This reduces the data that needs to be transferred over the bridge, which can improve performance especially for high-resolution images. | <code>false</code> | 1.1.0 |
|
|
581
732
|
|
|
582
733
|
|
|
734
|
+
#### VideoRecordingOptions
|
|
735
|
+
|
|
736
|
+
Configuration options for video recording.
|
|
737
|
+
|
|
738
|
+
| Prop | Type | Description | Default | Since |
|
|
739
|
+
| ------------------ | ----------------------------------------------------------------------- | ------------------------------------------------------------------------------------ | ---------------------- | ----- |
|
|
740
|
+
| **`enableAudio`** | <code>boolean</code> | Whether to record audio with the video. Requires microphone permission. | <code>false</code> | 2.2.0 |
|
|
741
|
+
| **`videoQuality`** | <code><a href="#videorecordingquality">VideoRecordingQuality</a></code> | Video recording quality preset. Native platforms only (iOS/Android). Ignored on web. | <code>'highest'</code> | 2.2.0 |
|
|
742
|
+
|
|
743
|
+
|
|
744
|
+
#### VideoRecordingResponse
|
|
745
|
+
|
|
746
|
+
Response from stopping a video recording.
|
|
747
|
+
|
|
748
|
+
| Prop | Type | Description | Since |
|
|
749
|
+
| ------------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ----- |
|
|
750
|
+
| **`webPath`** | <code>string</code> | Web-accessible path to the recorded video file. On web, this is a blob URL. On iOS/Android, this is a path accessible via Capacitor's filesystem. | 2.2.0 |
|
|
751
|
+
|
|
752
|
+
|
|
583
753
|
#### GetAvailableDevicesResponse
|
|
584
754
|
|
|
585
755
|
Response for getting available camera devices.
|
|
@@ -651,11 +821,12 @@ Response for getting the current torch mode.
|
|
|
651
821
|
|
|
652
822
|
#### PermissionStatus
|
|
653
823
|
|
|
654
|
-
Response for the camera permission status.
|
|
824
|
+
Response for the camera and microphone permission status.
|
|
655
825
|
|
|
656
|
-
| Prop
|
|
657
|
-
|
|
|
658
|
-
| **`camera`**
|
|
826
|
+
| Prop | Type | Description |
|
|
827
|
+
| ---------------- | ----------------------------------------------------------- | -------------------------------------- |
|
|
828
|
+
| **`camera`** | <code><a href="#permissionstate">PermissionState</a></code> | The state of the camera permission |
|
|
829
|
+
| **`microphone`** | <code><a href="#permissionstate">PermissionState</a></code> | The state of the microphone permission |
|
|
659
830
|
|
|
660
831
|
|
|
661
832
|
#### PluginListenerHandle
|
|
@@ -693,6 +864,15 @@ Coordinates are normalized between 0 and 1 relative to the camera frame.
|
|
|
693
864
|
### Type Aliases
|
|
694
865
|
|
|
695
866
|
|
|
867
|
+
#### BarcodeType
|
|
868
|
+
|
|
869
|
+
Supported barcode types for detection.
|
|
870
|
+
Specifying only the barcode types you need can improve performance
|
|
871
|
+
and reduce battery consumption.
|
|
872
|
+
|
|
873
|
+
<code>'qr' | 'code128' | 'code39' | 'code39Mod43' | 'code93' | 'ean8' | 'ean13' | 'interleaved2of5' | 'itf14' | 'pdf417' | 'aztec' | 'dataMatrix' | 'upce'</code>
|
|
874
|
+
|
|
875
|
+
|
|
696
876
|
#### CameraPosition
|
|
697
877
|
|
|
698
878
|
Position options for the camera.
|
|
@@ -719,6 +899,13 @@ depending on the `saveToFile` option in the <a href="#captureoptions">CaptureOpt
|
|
|
719
899
|
<code>T['saveToFile'] extends true ? { /** The web path to the captured photo that can be used to set the src attribute of an image for efficient loading and rendering (when saveToFile is true) */ webPath: string; } : { /** The base64 encoded string of the captured photo (when saveToFile is false or undefined) */ photo: string; }</code>
|
|
720
900
|
|
|
721
901
|
|
|
902
|
+
#### VideoRecordingQuality
|
|
903
|
+
|
|
904
|
+
Video recording quality presets.
|
|
905
|
+
|
|
906
|
+
<code>'lowest' | 'sd' | 'hd' | 'fhd' | 'uhd' | 'highest'</code>
|
|
907
|
+
|
|
908
|
+
|
|
722
909
|
#### FlashMode
|
|
723
910
|
|
|
724
911
|
Flash mode options for the camera.
|
|
@@ -733,4 +920,13 @@ Flash mode options for the camera.
|
|
|
733
920
|
|
|
734
921
|
<code>'prompt' | 'prompt-with-rationale' | 'granted' | 'denied'</code>
|
|
735
922
|
|
|
923
|
+
|
|
924
|
+
#### CameraPermissionType
|
|
925
|
+
|
|
926
|
+
Permission types that can be requested.
|
|
927
|
+
- 'camera': Camera access permission
|
|
928
|
+
- 'microphone': Microphone access permission (needed for video recording with audio)
|
|
929
|
+
|
|
930
|
+
<code>'camera' | 'microphone'</code>
|
|
931
|
+
|
|
736
932
|
</docgen-api>
|
package/android/build.gradle
CHANGED
|
@@ -16,7 +16,7 @@ buildscript {
|
|
|
16
16
|
mavenCentral()
|
|
17
17
|
}
|
|
18
18
|
dependencies {
|
|
19
|
-
classpath 'com.android.tools.build:gradle:8.13.
|
|
19
|
+
classpath 'com.android.tools.build:gradle:8.13.2'
|
|
20
20
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
|
21
21
|
}
|
|
22
22
|
}
|
|
@@ -37,10 +37,10 @@ android {
|
|
|
37
37
|
buildTypes {
|
|
38
38
|
release {
|
|
39
39
|
minifyEnabled false
|
|
40
|
-
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
|
40
|
+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
|
-
|
|
43
|
+
lint {
|
|
44
44
|
abortOnError = false
|
|
45
45
|
}
|
|
46
46
|
compileOptions {
|
|
@@ -66,19 +66,23 @@ dependencies {
|
|
|
66
66
|
implementation project(':capacitor-android')
|
|
67
67
|
implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
|
|
68
68
|
implementation 'androidx.core:core-ktx:1.16.0'
|
|
69
|
-
implementation 'androidx.compose.material3:material3-android:1.
|
|
69
|
+
implementation 'androidx.compose.material3:material3-android:1.4.0'
|
|
70
70
|
testImplementation "junit:junit:$junitVersion"
|
|
71
71
|
androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
|
|
72
72
|
androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion"
|
|
73
73
|
|
|
74
74
|
// CameraX dependencies
|
|
75
|
-
def camerax_version = "1.
|
|
75
|
+
def camerax_version = "1.5.3"
|
|
76
76
|
implementation "androidx.camera:camera-core:${camerax_version}"
|
|
77
77
|
implementation "androidx.camera:camera-camera2:${camerax_version}"
|
|
78
78
|
implementation "androidx.camera:camera-lifecycle:${camerax_version}"
|
|
79
79
|
implementation "androidx.camera:camera-view:${camerax_version}"
|
|
80
80
|
implementation "androidx.camera:camera-mlkit-vision:${camerax_version}"
|
|
81
|
+
implementation "androidx.camera:camera-video:${camerax_version}"
|
|
81
82
|
|
|
82
83
|
// ML Kit for barcode scanning
|
|
83
84
|
implementation "com.google.mlkit:barcode-scanning:17.3.0"
|
|
85
|
+
|
|
86
|
+
// Kotlin coroutines for modern async handling
|
|
87
|
+
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.10.2"
|
|
84
88
|
}
|