@capgo/camera-preview 7.3.9 → 7.4.0-beta.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.
Files changed (55) hide show
  1. package/CapgoCameraPreview.podspec +16 -13
  2. package/README.md +298 -68
  3. package/android/.gradle/8.14.2/checksums/checksums.lock +0 -0
  4. package/android/.gradle/8.14.2/checksums/sha1-checksums.bin +0 -0
  5. package/android/.gradle/8.14.2/executionHistory/executionHistory.bin +0 -0
  6. package/android/.gradle/8.14.2/executionHistory/executionHistory.lock +0 -0
  7. package/android/.gradle/8.14.2/fileChanges/last-build.bin +0 -0
  8. package/android/.gradle/8.14.2/fileHashes/fileHashes.bin +0 -0
  9. package/android/.gradle/8.14.2/fileHashes/fileHashes.lock +0 -0
  10. package/android/.gradle/8.14.2/fileHashes/resourceHashesCache.bin +0 -0
  11. package/android/.gradle/8.14.2/gc.properties +0 -0
  12. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  13. package/android/.gradle/buildOutputCleanup/cache.properties +2 -0
  14. package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
  15. package/android/.gradle/file-system.probe +0 -0
  16. package/android/.gradle/vcs-1/gc.properties +0 -0
  17. package/android/build.gradle +9 -0
  18. package/android/src/main/java/com/ahm/capacitor/camera/preview/CameraPreview.java +239 -545
  19. package/android/src/main/java/com/ahm/capacitor/camera/preview/CameraXView.java +848 -0
  20. package/android/src/main/java/com/ahm/capacitor/camera/preview/model/CameraDevice.java +54 -0
  21. package/android/src/main/java/com/ahm/capacitor/camera/preview/model/CameraLens.java +70 -0
  22. package/android/src/main/java/com/ahm/capacitor/camera/preview/model/CameraSessionConfiguration.java +65 -0
  23. package/android/src/main/java/com/ahm/capacitor/camera/preview/model/LensInfo.java +34 -0
  24. package/android/src/main/java/com/ahm/capacitor/camera/preview/model/ZoomFactors.java +34 -0
  25. package/dist/docs.json +702 -151
  26. package/dist/esm/definitions.d.ts +326 -80
  27. package/dist/esm/definitions.js +10 -1
  28. package/dist/esm/definitions.js.map +1 -1
  29. package/dist/esm/web.d.ts +27 -1
  30. package/dist/esm/web.js +244 -4
  31. package/dist/esm/web.js.map +1 -1
  32. package/dist/plugin.cjs.js +254 -4
  33. package/dist/plugin.cjs.js.map +1 -1
  34. package/dist/plugin.js +254 -4
  35. package/dist/plugin.js.map +1 -1
  36. package/ios/{Plugin → Sources/CapgoCameraPreview}/CameraController.swift +359 -34
  37. package/ios/{Plugin → Sources/CapgoCameraPreview}/Plugin.swift +307 -16
  38. package/ios/Tests/CameraPreviewPluginTests/CameraPreviewPluginTests.swift +15 -0
  39. package/package.json +1 -1
  40. package/android/src/main/java/com/ahm/capacitor/camera/preview/CameraActivity.java +0 -1279
  41. package/android/src/main/java/com/ahm/capacitor/camera/preview/CustomSurfaceView.java +0 -29
  42. package/android/src/main/java/com/ahm/capacitor/camera/preview/CustomTextureView.java +0 -39
  43. package/android/src/main/java/com/ahm/capacitor/camera/preview/Preview.java +0 -461
  44. package/android/src/main/java/com/ahm/capacitor/camera/preview/TapGestureDetector.java +0 -24
  45. package/ios/Plugin/Info.plist +0 -24
  46. package/ios/Plugin/Plugin.h +0 -10
  47. package/ios/Plugin/Plugin.m +0 -18
  48. package/ios/Plugin.xcodeproj/project.pbxproj +0 -593
  49. package/ios/Plugin.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -7
  50. package/ios/Plugin.xcworkspace/contents.xcworkspacedata +0 -10
  51. package/ios/Plugin.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
  52. package/ios/PluginTests/Info.plist +0 -22
  53. package/ios/PluginTests/PluginTests.swift +0 -83
  54. package/ios/Podfile +0 -13
  55. package/ios/Podfile.lock +0 -23
@@ -1,14 +1,17 @@
1
+ require 'json'
1
2
 
2
- Pod::Spec.new do |s|
3
- s.name = 'CapgoCameraPreview'
4
- s.version = '2.0.0'
5
- s.summary = 'Camera preview'
6
- s.license = 'MIT'
7
- s.homepage = 'https://github.com/Cap-go/camera-preview.git'
8
- s.author = 'Ariel Hernandez Musa'
9
- s.source = { :git => 'https://github.com/Cap-go/camera-preview.git', :tag => s.version.to_s }
10
- s.source_files = 'ios/Plugin/**/*.{swift,h,m,c,cc,mm,cpp}'
11
- s.ios.deployment_target = '14.0'
12
- s.dependency 'Capacitor'
13
- s.swift_version = '5.1'
14
- end
3
+ package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
4
+
5
+ Pod::Spec.new do |s|
6
+ s.name = 'CapgoCameraPreview'
7
+ s.version = package['version']
8
+ s.summary = package['description']
9
+ s.license = package['license']
10
+ s.homepage = package['repository']['url']
11
+ s.author = package['author']
12
+ s.source = { :git => package['repository']['url'], :tag => s.version.to_s }
13
+ s.source_files = 'ios/Sources/**/*.{swift,h,m,c,cc,mm,cpp}'
14
+ s.ios.deployment_target = '14.0'
15
+ s.dependency 'Capacitor'
16
+ s.swift_version = '5.1'
17
+ end
package/README.md CHANGED
@@ -181,25 +181,36 @@ Documentation for the [uploader](https://github.com/Cap-go/capacitor-uploader)
181
181
  * [`setOpacity(...)`](#setopacity)
182
182
  * [`stopRecordVideo()`](#stoprecordvideo)
183
183
  * [`startRecordVideo(...)`](#startrecordvideo)
184
+ * [`isRunning()`](#isrunning)
185
+ * [`getAvailableDevices()`](#getavailabledevices)
186
+ * [`getZoom()`](#getzoom)
187
+ * [`setZoom(...)`](#setzoom)
188
+ * [`getFlashMode()`](#getflashmode)
189
+ * [`removeAllListeners()`](#removealllisteners)
190
+ * [`setDeviceId(...)`](#setdeviceid)
191
+ * [`getDeviceId()`](#getdeviceid)
184
192
  * [Interfaces](#interfaces)
185
193
  * [Type Aliases](#type-aliases)
194
+ * [Enums](#enums)
186
195
 
187
196
  </docgen-index>
188
197
 
189
198
  <docgen-api>
190
199
  <!--Update the source file JSDoc comments and rerun docgen to update the docs below-->
191
200
 
201
+ The main interface for the CameraPreview plugin.
202
+
192
203
  ### start(...)
193
204
 
194
205
  ```typescript
195
206
  start(options: CameraPreviewOptions) => Promise<void>
196
207
  ```
197
208
 
198
- Start the camera preview instance.
209
+ Starts the camera preview.
199
210
 
200
- | Param | Type | Description |
201
- | ------------- | --------------------------------------------------------------------- | -------------------------------------------- |
202
- | **`options`** | <code><a href="#camerapreviewoptions">CameraPreviewOptions</a></code> | the options to start the camera preview with |
211
+ | Param | Type | Description |
212
+ | ------------- | --------------------------------------------------------------------- | ------------------------------------------- |
213
+ | **`options`** | <code><a href="#camerapreviewoptions">CameraPreviewOptions</a></code> | - The configuration for the camera preview. |
203
214
 
204
215
  **Since:** 0.0.1
205
216
 
@@ -212,7 +223,7 @@ Start the camera preview instance.
212
223
  stop() => Promise<void>
213
224
  ```
214
225
 
215
- Stop the camera preview instance.
226
+ Stops the camera preview.
216
227
 
217
228
  **Since:** 0.0.1
218
229
 
@@ -225,11 +236,11 @@ Stop the camera preview instance.
225
236
  capture(options: CameraPreviewPictureOptions) => Promise<{ value: string; }>
226
237
  ```
227
238
 
228
- Switch camera.
239
+ Captures a picture from the camera.
229
240
 
230
- | Param | Type | Description |
231
- | ------------- | ----------------------------------------------------------------------------------- | ------------------------------------- |
232
- | **`options`** | <code><a href="#camerapreviewpictureoptions">CameraPreviewPictureOptions</a></code> | the options to switch the camera with |
241
+ | Param | Type | Description |
242
+ | ------------- | ----------------------------------------------------------------------------------- | ---------------------------------------- |
243
+ | **`options`** | <code><a href="#camerapreviewpictureoptions">CameraPreviewPictureOptions</a></code> | - The options for capturing the picture. |
233
244
 
234
245
  **Returns:** <code>Promise&lt;{ value: string; }&gt;</code>
235
246
 
@@ -244,11 +255,11 @@ Switch camera.
244
255
  captureSample(options: CameraSampleOptions) => Promise<{ value: string; }>
245
256
  ```
246
257
 
247
- Capture a sample image.
258
+ Captures a single frame from the camera preview stream.
248
259
 
249
- | Param | Type | Description |
250
- | ------------- | ------------------------------------------------------------------- | -------------------------------------------- |
251
- | **`options`** | <code><a href="#camerasampleoptions">CameraSampleOptions</a></code> | the options to capture the sample image with |
260
+ | Param | Type | Description |
261
+ | ------------- | ------------------------------------------------------------------- | --------------------------------------- |
262
+ | **`options`** | <code><a href="#camerasampleoptions">CameraSampleOptions</a></code> | - The options for capturing the sample. |
252
263
 
253
264
  **Returns:** <code>Promise&lt;{ value: string; }&gt;</code>
254
265
 
@@ -263,7 +274,7 @@ Capture a sample image.
263
274
  getSupportedFlashModes() => Promise<{ result: CameraPreviewFlashMode[]; }>
264
275
  ```
265
276
 
266
- Get supported flash modes.
277
+ Gets the flash modes supported by the active camera.
267
278
 
268
279
  **Returns:** <code>Promise&lt;{ result: CameraPreviewFlashMode[]; }&gt;</code>
269
280
 
@@ -275,12 +286,13 @@ Get supported flash modes.
275
286
  ### getHorizontalFov()
276
287
 
277
288
  ```typescript
278
- getHorizontalFov() => Promise<{ result: any; }>
289
+ getHorizontalFov() => Promise<{ result: number; }>
279
290
  ```
280
291
 
281
- Get horizontal field of view.
292
+ Gets the horizontal field of view (FoV) for the active camera.
293
+ Note: This can be an estimate on some devices.
282
294
 
283
- **Returns:** <code>Promise&lt;{ result: any; }&gt;</code>
295
+ **Returns:** <code>Promise&lt;{ result: number; }&gt;</code>
284
296
 
285
297
  **Since:** 0.0.1
286
298
 
@@ -290,12 +302,14 @@ Get horizontal field of view.
290
302
  ### getSupportedPictureSizes()
291
303
 
292
304
  ```typescript
293
- getSupportedPictureSizes() => Promise<{ supportedPictureSizes: { facing: string; supportedPictureSizes: { width: number; height: number; }[]; }[]; }>
305
+ getSupportedPictureSizes() => Promise<{ supportedPictureSizes: SupportedPictureSizes[]; }>
294
306
  ```
295
307
 
296
- Gets the supported picture sizes for a given device.
308
+ Gets the supported picture sizes for all cameras.
309
+
310
+ **Returns:** <code>Promise&lt;{ supportedPictureSizes: SupportedPictureSizes[]; }&gt;</code>
297
311
 
298
- **Returns:** <code>Promise&lt;{ supportedPictureSizes: { facing: string; supportedPictureSizes: { width: number; height: number; }[]; }[]; }&gt;</code>
312
+ **Since:** 7.4.0
299
313
 
300
314
  --------------------
301
315
 
@@ -306,11 +320,11 @@ Gets the supported picture sizes for a given device.
306
320
  setFlashMode(options: { flashMode: CameraPreviewFlashMode | string; }) => Promise<void>
307
321
  ```
308
322
 
309
- Set flash mode.
323
+ Sets the flash mode for the active camera.
310
324
 
311
- | Param | Type | Description |
312
- | ------------- | ----------------------------------- | -------------------------------------- |
313
- | **`options`** | <code>{ flashMode: string; }</code> | the options to set the flash mode with |
325
+ | Param | Type | Description |
326
+ | ------------- | ----------------------------------- | ------------------------- |
327
+ | **`options`** | <code>{ flashMode: string; }</code> | - The desired flash mode. |
314
328
 
315
329
  **Since:** 0.0.1
316
330
 
@@ -323,7 +337,7 @@ Set flash mode.
323
337
  flip() => Promise<void>
324
338
  ```
325
339
 
326
- Flip camera.
340
+ Toggles between the front and rear cameras.
327
341
 
328
342
  **Since:** 0.0.1
329
343
 
@@ -336,11 +350,11 @@ Flip camera.
336
350
  setOpacity(options: CameraOpacityOptions) => Promise<void>
337
351
  ```
338
352
 
339
- Set opacity.
353
+ Sets the opacity of the camera preview.
340
354
 
341
- | Param | Type | Description |
342
- | ------------- | --------------------------------------------------------------------- | ------------------------------------------ |
343
- | **`options`** | <code><a href="#cameraopacityoptions">CameraOpacityOptions</a></code> | the options to set the camera opacity with |
355
+ | Param | Type | Description |
356
+ | ------------- | --------------------------------------------------------------------- | ---------------------- |
357
+ | **`options`** | <code><a href="#cameraopacityoptions">CameraOpacityOptions</a></code> | - The opacity options. |
344
358
 
345
359
  **Since:** 0.0.1
346
360
 
@@ -353,7 +367,7 @@ Set opacity.
353
367
  stopRecordVideo() => Promise<{ videoFilePath: string; }>
354
368
  ```
355
369
 
356
- Stop recording video.
370
+ Stops an ongoing video recording.
357
371
 
358
372
  **Returns:** <code>Promise&lt;{ videoFilePath: string; }&gt;</code>
359
373
 
@@ -368,67 +382,259 @@ Stop recording video.
368
382
  startRecordVideo(options: CameraPreviewOptions) => Promise<void>
369
383
  ```
370
384
 
371
- Start recording video.
385
+ Starts recording a video.
372
386
 
373
- | Param | Type | Description |
374
- | ------------- | --------------------------------------------------------------------- | ----------------------------------------- |
375
- | **`options`** | <code><a href="#camerapreviewoptions">CameraPreviewOptions</a></code> | the options to start recording video with |
387
+ | Param | Type | Description |
388
+ | ------------- | --------------------------------------------------------------------- | ---------------------------------- |
389
+ | **`options`** | <code><a href="#camerapreviewoptions">CameraPreviewOptions</a></code> | - The options for video recording. |
376
390
 
377
391
  **Since:** 0.0.1
378
392
 
379
393
  --------------------
380
394
 
381
395
 
396
+ ### isRunning()
397
+
398
+ ```typescript
399
+ isRunning() => Promise<{ isRunning: boolean; }>
400
+ ```
401
+
402
+ Checks if the camera preview is currently running.
403
+
404
+ **Returns:** <code>Promise&lt;{ isRunning: boolean; }&gt;</code>
405
+
406
+ **Since:** 7.4.0
407
+
408
+ --------------------
409
+
410
+
411
+ ### getAvailableDevices()
412
+
413
+ ```typescript
414
+ getAvailableDevices() => Promise<{ devices: CameraDevice[]; }>
415
+ ```
416
+
417
+ Gets all available camera devices.
418
+
419
+ **Returns:** <code>Promise&lt;{ devices: CameraDevice[]; }&gt;</code>
420
+
421
+ **Since:** 7.4.0
422
+
423
+ --------------------
424
+
425
+
426
+ ### getZoom()
427
+
428
+ ```typescript
429
+ getZoom() => Promise<{ min: number; max: number; current: number; lens: LensInfo; }>
430
+ ```
431
+
432
+ Gets the current zoom state, including min/max and current lens info.
433
+
434
+ **Returns:** <code>Promise&lt;{ min: number; max: number; current: number; lens: <a href="#lensinfo">LensInfo</a>; }&gt;</code>
435
+
436
+ **Since:** 7.4.0
437
+
438
+ --------------------
439
+
440
+
441
+ ### setZoom(...)
442
+
443
+ ```typescript
444
+ setZoom(options: { level: number; ramp?: boolean; }) => Promise<void>
445
+ ```
446
+
447
+ Sets the camera's zoom level.
448
+
449
+ | Param | Type | Description |
450
+ | ------------- | ----------------------------------------------- | ----------------------------------------------------- |
451
+ | **`options`** | <code>{ level: number; ramp?: boolean; }</code> | - The desired zoom level. `ramp` is currently unused. |
452
+
453
+ **Since:** 7.4.0
454
+
455
+ --------------------
456
+
457
+
458
+ ### getFlashMode()
459
+
460
+ ```typescript
461
+ getFlashMode() => Promise<{ flashMode: FlashMode; }>
462
+ ```
463
+
464
+ Gets the current flash mode.
465
+
466
+ **Returns:** <code>Promise&lt;{ flashMode: <a href="#camerapreviewflashmode">CameraPreviewFlashMode</a>; }&gt;</code>
467
+
468
+ **Since:** 7.4.0
469
+
470
+ --------------------
471
+
472
+
473
+ ### removeAllListeners()
474
+
475
+ ```typescript
476
+ removeAllListeners() => Promise<void>
477
+ ```
478
+
479
+ Removes all registered listeners.
480
+
481
+ **Since:** 7.4.0
482
+
483
+ --------------------
484
+
485
+
486
+ ### setDeviceId(...)
487
+
488
+ ```typescript
489
+ setDeviceId(options: { deviceId: string; }) => Promise<void>
490
+ ```
491
+
492
+ Switches the active camera to the one with the specified `deviceId`.
493
+
494
+ | Param | Type | Description |
495
+ | ------------- | ---------------------------------- | ------------------------------------ |
496
+ | **`options`** | <code>{ deviceId: string; }</code> | - The ID of the device to switch to. |
497
+
498
+ **Since:** 7.4.0
499
+
500
+ --------------------
501
+
502
+
503
+ ### getDeviceId()
504
+
505
+ ```typescript
506
+ getDeviceId() => Promise<{ deviceId: string; }>
507
+ ```
508
+
509
+ Gets the ID of the currently active camera device.
510
+
511
+ **Returns:** <code>Promise&lt;{ deviceId: string; }&gt;</code>
512
+
513
+ **Since:** 7.4.0
514
+
515
+ --------------------
516
+
517
+
382
518
  ### Interfaces
383
519
 
384
520
 
385
521
  #### CameraPreviewOptions
386
522
 
387
- | Prop | Type | Description |
388
- | ---------------------------------- | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
389
- | **`parent`** | <code>string</code> | Parent element to attach the video preview element to (applicable to the web platform only) |
390
- | **`className`** | <code>string</code> | Class name to add to the video preview element (applicable to the web platform only) |
391
- | **`width`** | <code>number</code> | The preview width in pixels, default window.screen.width |
392
- | **`height`** | <code>number</code> | The preview height in pixels, default window.screen.height |
393
- | **`x`** | <code>number</code> | The x origin, default 0 (applicable to the android and ios platforms only) |
394
- | **`y`** | <code>number</code> | The y origin, default 0 (applicable to the android and ios platforms only) |
395
- | **`includeSafeAreaInsets`** | <code>boolean</code> | Whether to include safe area insets in y-position calculation, default false (applicable to the ios platform only) |
396
- | **`toBack`** | <code>boolean</code> | Brings your html in front of your preview, default false (applicable to the android only) |
397
- | **`paddingBottom`** | <code>number</code> | The preview bottom padding in pixes. Useful to keep the appropriate preview sizes when orientation changes (applicable to the android and ios platforms only) |
398
- | **`rotateWhenOrientationChanged`** | <code>boolean</code> | Rotate preview when orientation changes (applicable to the ios platforms only; default value is true) |
399
- | **`position`** | <code>string</code> | Choose the camera to use 'front' or 'rear', default 'front' |
400
- | **`storeToFile`** | <code>boolean</code> | Defaults to false - Capture images to a file and return the file path instead of returning base64 encoded data |
401
- | **`disableExifHeaderStripping`** | <code>boolean</code> | Defaults to false - Android Only - Disable automatic rotation of the image, and let the browser deal with it (keep reading on how to achieve it) |
402
- | **`enableHighResolution`** | <code>boolean</code> | Defaults to false - iOS only - Activate high resolution image capture so that output images are from the highest resolution possible on the device * |
403
- | **`disableAudio`** | <code>boolean</code> | Defaults to false - Disables audio stream to prevent permission requests and output switching |
404
- | **`lockAndroidOrientation`** | <code>boolean</code> | Android Only - Locks device orientation when camera is showing. |
405
- | **`enableOpacity`** | <code>boolean</code> | Defaults to false - Android and Web only. Set if camera preview can change opacity. |
406
- | **`enableZoom`** | <code>boolean</code> | Defaults to false - Android only. Set if camera preview will support pinch to zoom. |
407
- | **`cameraMode`** | <code>boolean</code> | default to false - IOS only. Set the CameraPreview to use the video mode preset |
523
+ Defines the configuration options for starting the camera preview.
524
+
525
+ | Prop | Type | Description | Default |
526
+ | ---------------------------------- | -------------------- | ----------------------------------------------------------------------------------------------------------------- | ------------------- |
527
+ | **`parent`** | <code>string</code> | The parent element to attach the video preview to. | |
528
+ | **`className`** | <code>string</code> | A CSS class name to add to the preview element. | |
529
+ | **`width`** | <code>number</code> | The width of the preview in pixels. Defaults to the screen width. | |
530
+ | **`height`** | <code>number</code> | The height of the preview in pixels. Defaults to the screen height. | |
531
+ | **`x`** | <code>number</code> | The horizontal origin of the preview, in pixels. | |
532
+ | **`y`** | <code>number</code> | The vertical origin of the preview, in pixels. | |
533
+ | **`includeSafeAreaInsets`** | <code>boolean</code> | Adjusts the y-position to account for safe areas (e.g., notches). | <code>false</code> |
534
+ | **`toBack`** | <code>boolean</code> | If true, places the preview behind the webview. | <code>true</code> |
535
+ | **`paddingBottom`** | <code>number</code> | Bottom padding for the preview, in pixels. | |
536
+ | **`rotateWhenOrientationChanged`** | <code>boolean</code> | Whether to rotate the preview when the device orientation changes. | <code>true</code> |
537
+ | **`position`** | <code>string</code> | The camera to use. | <code>"rear"</code> |
538
+ | **`storeToFile`** | <code>boolean</code> | If true, saves the captured image to a file and returns the file path. If false, returns a base64 encoded string. | <code>false</code> |
539
+ | **`disableExifHeaderStripping`** | <code>boolean</code> | If true, prevents the plugin from rotating the image based on EXIF data. | <code>false</code> |
540
+ | **`enableHighResolution`** | <code>boolean</code> | If true, enables high-resolution image capture. | <code>false</code> |
541
+ | **`disableAudio`** | <code>boolean</code> | If true, disables the audio stream, preventing audio permission requests. | <code>false</code> |
542
+ | **`lockAndroidOrientation`** | <code>boolean</code> | If true, locks the device orientation while the camera is active. | <code>false</code> |
543
+ | **`enableOpacity`** | <code>boolean</code> | If true, allows the camera preview's opacity to be changed. | <code>false</code> |
544
+ | **`enableZoom`** | <code>boolean</code> | If true, enables pinch-to-zoom functionality on the preview. | <code>false</code> |
545
+ | **`enableVideoMode`** | <code>boolean</code> | If true, uses the video-optimized preset for the camera session. | <code>false</code> |
546
+ | **`deviceId`** | <code>string</code> | The `deviceId` of the camera to use. If provided, `position` is ignored. | |
408
547
 
409
548
 
410
549
  #### CameraPreviewPictureOptions
411
550
 
412
- | Prop | Type | Description |
413
- | ------------- | ------------------------------------------------------- | ------------------------------------------------------------------------------------ |
414
- | **`height`** | <code>number</code> | The picture height, optional, default 0 (Device default) |
415
- | **`width`** | <code>number</code> | The picture width, optional, default 0 (Device default) |
416
- | **`quality`** | <code>number</code> | The picture quality, 0 - 100, default 85 |
417
- | **`format`** | <code><a href="#pictureformat">PictureFormat</a></code> | The picture format, jpeg or png, default jpeg on `Web`. quality has no effect on png |
551
+ Defines the options for capturing a picture.
552
+
553
+ | Prop | Type | Description | Default |
554
+ | ------------- | ------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ------------------- |
555
+ | **`height`** | <code>number</code> | The desired height of the picture in pixels. If not provided, the device default is used. | |
556
+ | **`width`** | <code>number</code> | The desired width of the picture in pixels. If not provided, the device default is used. | |
557
+ | **`quality`** | <code>number</code> | The quality of the captured image, from 0 to 100. Does not apply to `png` format. | <code>85</code> |
558
+ | **`format`** | <code><a href="#pictureformat">PictureFormat</a></code> | The format of the captured image. | <code>"jpeg"</code> |
418
559
 
419
560
 
420
561
  #### CameraSampleOptions
421
562
 
422
- | Prop | Type | Description |
423
- | ------------- | ------------------- | ---------------------------------------- |
424
- | **`quality`** | <code>number</code> | The picture quality, 0 - 100, default 85 |
563
+ Defines the options for capturing a sample frame from the camera preview.
564
+
565
+ | Prop | Type | Description | Default |
566
+ | ------------- | ------------------- | -------------------------------------------------- | --------------- |
567
+ | **`quality`** | <code>number</code> | The quality of the captured sample, from 0 to 100. | <code>85</code> |
568
+
569
+
570
+ #### SupportedPictureSizes
571
+
572
+ Represents the supported picture sizes for a camera facing a certain direction.
573
+
574
+ | Prop | Type | Description |
575
+ | --------------------------- | -------------------------- | -------------------------------------------------- |
576
+ | **`facing`** | <code>string</code> | The camera direction ("front" or "rear"). |
577
+ | **`supportedPictureSizes`** | <code>PictureSize[]</code> | A list of supported picture sizes for this camera. |
578
+
579
+
580
+ #### PictureSize
581
+
582
+ Defines a standard picture size with width and height.
583
+
584
+ | Prop | Type | Description |
585
+ | ------------ | ------------------- | ------------------------------------ |
586
+ | **`width`** | <code>number</code> | The width of the picture in pixels. |
587
+ | **`height`** | <code>number</code> | The height of the picture in pixels. |
425
588
 
426
589
 
427
590
  #### CameraOpacityOptions
428
591
 
429
- | Prop | Type | Description |
430
- | ------------- | ------------------- | ----------------------------------------------------- |
431
- | **`opacity`** | <code>number</code> | The percent opacity to set for camera view, default 1 |
592
+ Defines the options for setting the camera preview's opacity.
593
+
594
+ | Prop | Type | Description | Default |
595
+ | ------------- | ------------------- | --------------------------------------------------------------------------- | ---------------- |
596
+ | **`opacity`** | <code>number</code> | The opacity percentage, from 0.0 (fully transparent) to 1.0 (fully opaque). | <code>1.0</code> |
597
+
598
+
599
+ #### CameraDevice
600
+
601
+ Represents a physical camera on the device (e.g., the front-facing camera).
602
+
603
+ | Prop | Type | Description |
604
+ | --------------- | --------------------------------------------------------- | ----------------------------------------------------------------------------------------- |
605
+ | **`deviceId`** | <code>string</code> | A unique identifier for the camera device. |
606
+ | **`label`** | <code>string</code> | A human-readable name for the camera device. |
607
+ | **`position`** | <code><a href="#cameraposition">CameraPosition</a></code> | The physical position of the camera on the device. |
608
+ | **`lenses`** | <code>CameraLens[]</code> | A list of all available lenses for this camera device. |
609
+ | **`minZoom`** | <code>number</code> | The overall minimum zoom factor available across all lenses on this device. |
610
+ | **`maxZoom`** | <code>number</code> | The overall maximum zoom factor available across all lenses on this device. |
611
+ | **`isLogical`** | <code>boolean</code> | Identifies whether the device is a logical camera (composed of multiple physical lenses). |
612
+
613
+
614
+ #### CameraLens
615
+
616
+ Represents a single camera lens on a device. A {@link <a href="#cameradevice">CameraDevice</a>} can have multiple lenses.
617
+
618
+ | Prop | Type | Description |
619
+ | ------------------- | ------------------------------------------------- | ---------------------------------------------------------------------------- |
620
+ | **`label`** | <code>string</code> | A human-readable name for the lens, e.g., "Ultra-Wide". |
621
+ | **`deviceType`** | <code><a href="#devicetype">DeviceType</a></code> | The type of the camera lens. |
622
+ | **`focalLength`** | <code>number</code> | The focal length of the lens in millimeters. |
623
+ | **`baseZoomRatio`** | <code>number</code> | The base zoom factor for this lens (e.g., 0.5 for ultra-wide, 1.0 for wide). |
624
+ | **`minZoom`** | <code>number</code> | The minimum zoom factor supported by this specific lens. |
625
+ | **`maxZoom`** | <code>number</code> | The maximum zoom factor supported by this specific lens. |
626
+
627
+
628
+ #### LensInfo
629
+
630
+ Represents the detailed information of the currently active lens.
631
+
632
+ | Prop | Type | Description |
633
+ | ------------------- | ------------------------------------------------- | ---------------------------------------------------------------- |
634
+ | **`focalLength`** | <code>number</code> | The focal length of the active lens in millimeters. |
635
+ | **`deviceType`** | <code><a href="#devicetype">DeviceType</a></code> | The device type of the active lens. |
636
+ | **`baseZoomRatio`** | <code>number</code> | The base zoom ratio of the active lens (e.g., 0.5x, 1.0x). |
637
+ | **`digitalZoom`** | <code>number</code> | The current digital zoom factor applied on top of the base zoom. |
432
638
 
433
639
 
434
640
  ### Type Aliases
@@ -446,6 +652,30 @@ Start recording video.
446
652
 
447
653
  #### CameraPreviewFlashMode
448
654
 
449
- <code>"off" | "on" | "auto" | "red-eye" | "torch"</code>
655
+ The available flash modes for the camera.
656
+ 'torch' is a continuous light mode.
657
+
658
+ <code>"off" | "on" | "auto" | "torch"</code>
659
+
660
+
661
+ #### FlashMode
662
+
663
+ <code><a href="#camerapreviewflashmode">CameraPreviewFlashMode</a></code>
664
+
665
+
666
+ ### Enums
667
+
668
+
669
+ #### DeviceType
670
+
671
+ | Members | Value |
672
+ | ---------------- | ------------------------ |
673
+ | **`ULTRA_WIDE`** | <code>"ultraWide"</code> |
674
+ | **`WIDE_ANGLE`** | <code>"wideAngle"</code> |
675
+ | **`TELEPHOTO`** | <code>"telephoto"</code> |
676
+ | **`TRUE_DEPTH`** | <code>"trueDepth"</code> |
677
+ | **`DUAL`** | <code>"dual"</code> |
678
+ | **`DUAL_WIDE`** | <code>"dualWide"</code> |
679
+ | **`TRIPLE`** | <code>"triple"</code> |
450
680
 
451
681
  </docgen-api>
File without changes
@@ -0,0 +1,2 @@
1
+ #Mon Jun 30 22:10:14 EEST 2025
2
+ gradle.version=8.14.2
File without changes
@@ -49,6 +49,15 @@ dependencies {
49
49
  implementation project(':capacitor-android')
50
50
  implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
51
51
  implementation 'androidx.exifinterface:exifinterface:1.4.1'
52
+
53
+ // CameraX dependencies
54
+ def camerax_version = "1.5.0-beta01"
55
+ implementation "androidx.camera:camera-core:${camerax_version}"
56
+ implementation "androidx.camera:camera-camera2:${camerax_version}"
57
+ implementation "androidx.camera:camera-lifecycle:${camerax_version}"
58
+ implementation "androidx.camera:camera-view:${camerax_version}"
59
+ implementation "androidx.camera:camera-extensions:${camerax_version}"
60
+
52
61
  testImplementation "junit:junit:$junitVersion"
53
62
  androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
54
63
  androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion"