Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
2fc8acc
(build) change: use local plugin version for demo
Mar 7, 2024
b46053d
feat: implement getMaxZoom(), getZoom(), setZoom() for Android and iOS
dpa99c Mar 7, 2024
4f4e6a7
(android) rework: use Camera2 API instead of legacy Camera API
dpa99c Feb 10, 2024
ec762ec
(ios) bugfix: fix calculation of x/y offsets to use hard-coded factor…
dpa99c Jun 10, 2024
5b9d31d
Merge branch 'ios_fix_pixel_ratio'
dpa99c Jun 10, 2024
eb1d400
(android) add support for getMaxZoomLimit(), setMaxZoomLimit(), maxZo…
dpa99c Jun 10, 2024
a9d3a8b
(ios) add support for getMaxZoomLimit(), setMaxZoomLimit(), maxZoomLi…
Jun 10, 2024
49fe26b
Merge branch 'max_zoom_limit'
dpa99c Jun 10, 2024
40c8806
(android) emit JS event when current zoom level changes
dpa99c Jun 10, 2024
b49d9c6
(ios) emit JS event when current zoom level changes
Jun 11, 2024
f73d89e
Merge branch 'events'
dpa99c Jun 11, 2024
5083df6
(android) fix: apply device pixel ratio when calculating optimal prev…
dpa99c Jun 16, 2024
a92d431
(android) fix: apply device pixel ratio when calculating optimal prev…
dpa99c Jun 16, 2024
5a5e47b
bugfix: don't try to restore previous orientation if it wasn't alread…
dpa99c Jun 19, 2024
41bca94
Merge branch 'android_camera_v2'
dpa99c Jun 19, 2024
d0f639e
(android) remove unused imports
dpa99c Jun 22, 2024
cf74a41
(android) enhance robustness with try/catch; code cleanup
dpa99c Jul 12, 2024
a2c6e35
(android) improve robustness of onCreateView
dpa99c Jul 30, 2024
9da391e
(android) fix: ensure all catch statements use generic Exception clas…
dpa99c Aug 12, 2024
70e2de5
(android) Tighten up exception handling.
dpa99c Aug 13, 2024
d2d8954
bump dependencies to capacitor@6
dpa99c Aug 13, 2024
c78740a
(android) send error/log events to JS layer via window object
dpa99c Aug 13, 2024
a368c6f
(android) fix: structure of messages sent to window object as events
dpa99c Aug 13, 2024
8545d42
(android) don't log error/log messages direct to JS console
dpa99c Aug 13, 2024
60e39f4
(android) fix: sanitise log messages sent to JS window object to ensu…
dpa99c Aug 13, 2024
3d8e04d
(android) if lockAndroidOrientation=true, ignore orientation changes …
dpa99c Nov 4, 2024
8fb1799
(android) enhance robustness with try/catch; code cleanup
dpa99c Jul 12, 2024
0b604f8
(android) improve robustness of onCreateView
dpa99c Jul 30, 2024
7fd66ed
(android) fix: ensure all catch statements use generic Exception clas…
dpa99c Aug 12, 2024
31d1a40
(android) Tighten up exception handling.
dpa99c Aug 13, 2024
30442fb
bump dependencies to capacitor@6
dpa99c Aug 13, 2024
de00e2b
(android) send error/log events to JS layer via window object
dpa99c Aug 13, 2024
d10adb7
(android) fix: structure of messages sent to window object as events
dpa99c Aug 13, 2024
a3faeb3
(android) don't log error/log messages direct to JS console
dpa99c Aug 13, 2024
4259020
(android) fix: sanitise log messages sent to JS window object to ensu…
dpa99c Aug 13, 2024
e8a217f
(android) if lockAndroidOrientation=true, ignore orientation changes …
dpa99c Nov 4, 2024
5af4602
feat: Implements getMaxZoom(), getZoom() and setZoom() as per the Cor…
dpa99c Nov 12, 2024
d59b814
Merge branch 'master' into android_camera_v2
dpa99c Nov 12, 2024
da388bb
(android) bugfix: correct the orientation when saving JPG file when u…
dpa99c Dec 13, 2024
40a123d
(android) bugfix: correct the orientation when saving JPG file when u…
dpa99c Dec 13, 2024
8bae750
Merge branch 'upstream_master' in master
dpa99c Mar 21, 2025
2e8a12c
fix merge error
dpa99c Mar 21, 2025
6476c07
(android) Implement retry behaviour if configuration fails, as this c…
dpa99c Aug 1, 2025
9742719
(android) Check if Camera2Api is fully supported, if not return an er…
dpa99c Aug 19, 2025
3a25afc
(android) Add a timeout for opening the camera preview to try to prev…
dpa99c Aug 19, 2025
772198a
(android) Include exception message in plugin call rejection message …
dpa99c Aug 20, 2025
3473257
(android) feat: Implement Camera1Api as a fallback for Camera2Api on …
Aug 29, 2025
be0a0d1
(android) Camera1Api: Fix orientation of taken photos
Aug 29, 2025
d393b15
(android) feat: add getCamera2SupportLevel() plugin method
Aug 29, 2025
ae00475
(build) track dist/ so plugin can be installed directly from github repo
Aug 29, 2025
12b693d
(android) replace deprecated call.error() with call.reject()
Aug 29, 2025
6a3648f
(android) Better handing of Camera2Api support check
Aug 29, 2025
0a7db9f
(android) improvements
Aug 29, 2025
e51877b
(android) logging improvements, performance optimisations, robustness…
Jan 23, 2026
5502116
run `fmt` task to autolint code
Jan 23, 2026
21c0b21
(android) Harden camera lifecycle, capture guards, and preview/sessio…
Jan 23, 2026
1bf483a
(ios) Robustness fixes:
Jan 23, 2026
8a715b8
(android) Fix Camera2 TextureView behaviour to ensure correct aspect …
Jan 23, 2026
72e6ada
Merge branch 'master' into android_camera_v2
dpa99c Jan 23, 2026
d4a6b99
Merge branch 'upstream_master' into android_camera_v2
dpa99c Jan 23, 2026
8864d9f
Address Copilot review comments
Jan 23, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ Starts the camera preview instance.
| lockAndroidOrientation | boolean | (optional) Locks device orientation when camera is showing, default false. (applicable to Android only) |
| enableOpacity | boolean | (optional) Make the camera preview see-through. Ideal for augmented reality uses. Default false (applicable to Android and web only) |
| enableZoom | boolean | (optional) Set if you can pinch to zoom. Default false (applicable to the android and ios platforms only) |
| maxZoomLimit | number | (optional) Set the max zoom level to limit the camera device to. Set to -1 for unlimited. Default -1 (applicable to the android and ios platforms only) |

<!-- <strong>Options:</strong>
All options stated are optional and will default to values here
Expand Down Expand Up @@ -331,6 +332,51 @@ myCamera.setOpacity({ opacity: 0.4 });
const { value } = await CameraPreview.isCameraStarted();
```

### getMaxZoom(): Promise<{value: number}>; ---- ANDROID and iOS only

<info>Get the maximum zoom level for the camera device currently started.</info><br/>

```javascript
const myCamera = CameraPreview.start();
const maxZoom = await CameraPreview.getMaxZoom();
```

### getZoom(): Promise<{value: number}>; ---- ANDROID and iOS only

<info>Get the current zoom level for the camera device currently started.</info><br/>

```javascript
const myCamera = CameraPreview.start();
const zoom = await CameraPreview.getZoom();
```

### setZoom({zoom: number}): Promise<void>; ---- ANDROID and iOS only

<info>Set the zoom level for the camera device currently started.</info><br/>

```javascript
const myCamera = CameraPreview.start();
await CameraPreview.setZoom({zoom: 2});
```

### getMaxZoomLimit(): Promise<{value: number}>; ---- ANDROID and iOS only

<info>Gets the current zoom max level which the camera device is limited to. -1 indicates unlimited.</info><br/>

```javascript
const myCamera = CameraPreview.start();
const zoomLimit = await CameraPreview.getMaxZoomLimit();
```

### setMaxZoomLimit({maxZoomLimit: number}): Promise<void>; ---- ANDROID and iOS only

<info>Sets the max zoom level to limit the camera device to. Set to -1 for unlimited.</info><br/>

```javascript
const myCamera = CameraPreview.start();
await CameraPreview.setMaxZoomLimit({maxZoomLimit: 5});
```

# Settings

<a name="camera_Settings.FlashMode"></a>
Expand Down
Loading