{"id":25687534,"url":"https://github.com/cap-go/capacitor-camera-preview","last_synced_at":"2026-04-10T19:03:36.532Z","repository":{"id":65308315,"uuid":"573703497","full_name":"Cap-go/capacitor-camera-preview","owner":"Cap-go","description":"Capacitor plugin that allows camera interaction from Javascript and HTML","archived":false,"fork":false,"pushed_at":"2025-04-14T09:58:47.000Z","size":2869,"stargazers_count":13,"open_issues_count":11,"forks_count":12,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-19T11:27:24.356Z","etag":null,"topics":["capacitor","capacitor-plugin","ionic"],"latest_commit_sha":null,"homepage":"https://capgo.app","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Cap-go.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"Cap-go","patreon":null,"open_collective":"capgo","ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2022-12-03T06:34:22.000Z","updated_at":"2025-04-14T09:58:12.000Z","dependencies_parsed_at":"2023-01-16T12:00:37.172Z","dependency_job_id":"39378b3e-3769-47ef-8e50-13e12bc79292","html_url":"https://github.com/Cap-go/capacitor-camera-preview","commit_stats":{"total_commits":618,"total_committers":50,"mean_commits":12.36,"dds":0.7491909385113269,"last_synced_commit":"183cba0762f5cfa2a155c701f7bfd579a9f39b8d"},"previous_names":["cap-go/capacitor-camera-preview","cap-go/camera-preview"],"tags_count":173,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cap-go%2Fcapacitor-camera-preview","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cap-go%2Fcapacitor-camera-preview/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cap-go%2Fcapacitor-camera-preview/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cap-go%2Fcapacitor-camera-preview/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Cap-go","download_url":"https://codeload.github.com/Cap-go/capacitor-camera-preview/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250536230,"owners_count":21446697,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["capacitor","capacitor-plugin","ionic"],"created_at":"2025-02-24T20:52:19.436Z","updated_at":"2026-04-10T19:03:36.516Z","avatar_url":"https://github.com/Cap-go.png","language":"Java","funding_links":["https://github.com/sponsors/Cap-go","https://opencollective.com/capgo"],"categories":[],"sub_categories":[],"readme":"# Capacitor Camera Preview Plugin\n\n\u003ca href=\"https://capgo.app/\"\u003e\u003cimg src='https://raw.githubusercontent.com/Cap-go/capgo/main/assets/capgo_banner.png' alt='Capgo - Instant updates for capacitor'/\u003e\u003c/a\u003e\n\n\u003cdiv align=\"center\"\u003e\n  \u003ch2\u003e\u003ca href=\"https://capgo.app/?ref=plugin_camera_preview\"\u003e ➡️ Get Instant updates for your App with Capgo\u003c/a\u003e\u003c/h2\u003e\n  \u003ch2\u003e\u003ca href=\"https://capgo.app/consulting/?ref=plugin_camera_preview\"\u003e Missing a feature? We’ll build the plugin for you 💪\u003c/a\u003e\u003c/h2\u003e\n\u003c/div\u003e\n\n\n![NPM Version](https://img.shields.io/npm/v/%40capgo%2Fcamera-preview)\n![NPM Downloads](https://img.shields.io/npm/dy/%40capgo%2Fcamera-preview)\n![GitHub Repo stars](https://img.shields.io/github/stars/Cap-go/capacitor-camera-preview)\n![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/Cap-go/capacitor-camera-preview/.github%2Fworkflows%2Fbuild.yml)\n![GitHub License](https://img.shields.io/github/license/Cap-go/capacitor-camera-preview)\n![Maintenance](https://img.shields.io/maintenance/yes/2025)\n\n\u003cp\u003e\n  Capacitor plugin that allows camera interaction from Javascript and HTML\u003cbr\u003e(based on cordova-plugin-camera-preview).\n\u003c/p\u003e\n\n## Why Camera Preview?\n\nA **free**, **fully-featured** alternative to paid camera plugins, built for maximum flexibility and performance:\n\n- **Complete UI control** - Build your own camera interface with HTML/JS overlays instead of native constraints\n- **Full hardware access** - Manual focus, zoom, exposure controls, flash modes, multiple cameras\n- **Video recording** - Record with custom settings, no arbitrary limitations\n- **Universal device support** - Tested across hundreds of Android and iOS devices\n- **Performance optimized** - Direct camera stream access, efficient memory usage\n- **Modern package management** - Supports both Swift Package Manager (SPM) and CocoaPods (SPM-ready for Capacitor 8)\n- **Same JavaScript API** - Compatible interface with paid alternatives\n\nUnlike restrictive paid plugins, you get full camera control to build exactly the experience you want - from QR scanners to professional video apps.\n\n\u003cbr\u003e\n\nThis plugin is compatible Capacitor 7 and above.\n\nUse v6 for Capacitor 6 and below.\n\n**PR's are greatly appreciated.**\n\n-- [@riderx](https://github.com/riderx), current maintainers\n\nRemember to add the style below on your app's HTML or body element:\n\n```css\n:root {\n  --ion-background-color: transparent !important;\n}\n```\n\nTake into account that this will make transparent all ion-content on application, if you want to show camera preview only in one page, just add a custom class to your ion-content and make it transparent:\n\n```css\n.my-custom-camera-preview-content {\n  --background: transparent;\n}\n```\n\nIf the camera preview is not displaying after applying the above styles, apply transparent background color to the root div element of the parent component\nEx: VueJS \u003e\u003e App.vue component\n```html\n\u003ctemplate\u003e\n  \u003cion-app id=\"app\"\u003e\n    \u003cion-router-outlet /\u003e\n  \u003c/ion-app\u003e\n\u003c/template\u003e\n\n\u003cstyle\u003e\n#app {\n  background-color: transparent !important;\n}\n\u003cstyle\u003e\n```\n\nIf it don't work in dark mode here is issue who explain how to fix it: https://github.com/capacitor-community/camera-preview/issues/199\n\n\u003c!-- # Features\n\n\u003cul\u003e\n  \u003cli\u003eStart a camera preview from HTML code.\u003c/li\u003e\n  \u003cli\u003eMaintain HTML interactivity.\u003c/li\u003e\n  \u003cli\u003eDrag the preview box.\u003c/li\u003e\n  \u003cli\u003eSet camera color effect.\u003c/li\u003e\n  \u003cli\u003eSend the preview box to back of the HTML content.\u003c/li\u003e\n  \u003cli\u003eSet a custom position for the camera preview box.\u003c/li\u003e\n  \u003cli\u003eSet a custom size for the preview box.\u003c/li\u003e\n  \u003cli\u003eSet a custom alpha for the preview box.\u003c/li\u003e\n  \u003cli\u003eSet the focus mode, zoom, color effects, exposure mode, white balance mode and exposure compensation\u003c/li\u003e\n  \u003cli\u003eTap to focus\u003c/li\u003e\n\u003c/ul\u003e --\u003e\n\n## Good to know\n\nVideo and photo taken with the plugin are never removed, so do not forget to remove them after used to not bloat the user phone.\n\nuse https://capacitorjs.com/docs/apis/filesystem#deletefile for that\n\n\n## Touch \u0026 Gestures (JS‑Driven)\n\n- Native tap‑to‑focus and pinch‑to‑zoom gesture handling are intentionally disabled on both Android and iOS.\n- Handle all user interactions in your HTML/JS layer, then call the plugin methods:\n  - Focus: `await CameraPreview.setFocus({ x, y })` with normalized coordinates (0–1) relative to the preview bounds.\n  - Zoom: `await CameraPreview.setZoom({ level })` using your own gesture/UI logic.\n- 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.\n- The `enableZoom` start option is removed. Use JS gestures + `setZoom(...)`.\n- Tip: When using `toBack: true`, the WebView is in front of the camera and receives touches; design your overlay UI there and drive focus/zoom through the JS API.\n\n## Fast base64 from file path (no bridge)\n\nWhen using `storeToFile: true`, you can avoid sending large base64 strings over the Capacitor bridge:\n\n```ts\nimport { CameraPreview, getBase64FromFilePath } from '@capgo/camera-preview'\n\nawait CameraPreview.start({ storeToFile: true });\n// Take a picture and get a file path\nconst { value: filePath } = await CameraPreview.capture({ quality: 85 })\n\n// Convert the file to base64 entirely on the JS side (fast, no bridge)\nconst base64 = await getBase64FromFilePath(filePath)\n\n// Optionally cleanup the temp file natively\nawait CameraPreview.deleteFile({ path: filePath })\n```\n\n\n## Exposure controls (iOS \u0026 Android)\n\nThis plugin exposes camera exposure controls on iOS and Android:\n\n- Exposure modes: `\"AUTO\" | \"LOCK\" | \"CONTINUOUS\" | \"CUSTOM\"`\n- Exposure compensation (EV bias): get range `{ min, max, step }`, read current value, and set new value\n\nPlatform notes:\n\n- iOS: The camera starts in `CONTINUOUS` by default. Switching to `AUTO` or `CONTINUOUS` resets EV to 0. The `step` value is approximated to 0.1 since iOS does not expose the bias step.\n- Android: AE lock/unlock and mode are handled via CameraX + Camera2 interop. The `step` value comes from CameraX `ExposureState` and may vary per device.\n\nExample (TypeScript):\n\n```ts\nimport { CameraPreview } from '@capgo/camera-preview';\n\n// Query supported modes\nconst { modes } = await CameraPreview.getExposureModes();\nconsole.log('Supported exposure modes:', modes);\n\n// Get current mode\nconst { mode } = await CameraPreview.getExposureMode();\nconsole.log('Current exposure mode:', mode);\n\n// Set mode (AUTO | LOCK | CONTINUOUS | CUSTOM)\nawait CameraPreview.setExposureMode({ mode: 'CONTINUOUS' });\n\n// Get EV range (with step)\nconst { min, max, step } = await CameraPreview.getExposureCompensationRange();\nconsole.log('EV range:', { min, max, step });\n\n// Read current EV\nconst { value: currentEV } = await CameraPreview.getExposureCompensation();\nconsole.log('Current EV:', currentEV);\n\n// Increment EV by one step and clamp to range\nconst nextEV = Math.max(min, Math.min(max, currentEV + step));\nawait CameraPreview.setExposureCompensation({ value: nextEV });\n```\n\nExample app (Ionic):\n\n- Exposure mode toggle (sun icon) cycles through modes.\n- EV controls (+/−) are placed in a top‑right floating action bar, outside the preview area.\n\n\n## Documentation\n\nThe most complete doc is available here: https://capgo.app/docs/plugins/camera-preview/\n\n# Installation\n\n```\nyarn add @capgo/camera-preview\n\nor\n\nnpm install @capgo/camera-preview\n```\n\nThen run\n\n```\nnpx cap sync\n```\n\n## Optional Configuration\n\nTo use certain features of this plugin, you will need to add the following permissions/keys to your native project configurations.\n\n### Android\n\nIn your `android/app/src/main/AndroidManifest.xml`:\n\n- **Audio Recording** (`disableAudio: false`):\n  ```xml\n  \u003cuses-permission android:name=\"android.permission.RECORD_AUDIO\" /\u003e\n  ```\n\n- **Saving to Gallery** (`saveToGallery: true`):\n  ```xml\n  \u003cuses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\" /\u003e\n  ```\n\n- **Location in EXIF Data** (`withExifLocation: true`):\n  ```xml\n  \u003cuses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\" /\u003e\n  \u003cuses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\" /\u003e\n  ```\n\n### iOS\n\nIn your `ios/App/App/Info.plist`, you must provide descriptions for the permissions your app requires. The keys are added automatically, but you need to provide the `string` values.\n\n- **Audio Recording** (`disableAudio: false`):\n  ```xml\n  \u003ckey\u003eNSMicrophoneUsageDescription\u003c/key\u003e\n  \u003cstring\u003eTo record audio with videos\u003c/string\u003e\n  ```\n\n- **Saving to Gallery** (`saveToGallery: true`):\n  ```xml\n  \u003ckey\u003eNSPhotoLibraryUsageDescription\u003c/key\u003e\n  \u003cstring\u003eTo save photos to your gallery\u003c/string\u003e\n  ```\n\n- **Location in EXIF Data** (`withExifLocation: true`):\n  ```xml\n  \u003ckey\u003eNSLocationWhenInUseUsageDescription\u003c/key\u003e\n  \u003cstring\u003eTo add location data to your photos\u003c/string\u003e\n  ```\n\n## Extra Android installation steps\n\n**Important** `camera-preview` 3+ requires Gradle 7.\nOpen `android/app/src/main/AndroidManifest.xml` and above the closing `\u003c/manifest\u003e` tag add this line to request the CAMERA permission:\n\n```xml\n\u003cuses-permission android:name=\"android.permission.CAMERA\" /\u003e\n\u003cuses-permission android:name=\"android.permission.RECORD_AUDIO\" /\u003e\n\u003cuses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\" /\u003e\n\u003cuses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\" /\u003e\n\n```\n\nFor more help consult the [Capacitor docs](https://capacitorjs.com/docs/android/configuration#configuring-androidmanifestxml).\n\n## Extra iOS installation steps\n\nYou will need to add two permissions to `Info.plist`. Follow the [Capacitor docs](https://capacitorjs.com/docs/ios/configuration#configuring-infoplist) and add permissions with the raw keys `NSCameraUsageDescription` and `NSMicrophoneUsageDescription`. `NSMicrophoneUsageDescription` is only required, if audio will be used. Otherwise set the `disableAudio` option to `true`, which also disables the microphone permission request.\n\n## Extra Web installation steps\n\nAdd `import '@capgo/camera-preview'` to you entry script in ionic on `app.module.ts`, so capacitor can register the web platform from the plugin\n\n### Example with Capacitor uploader:\n\nDocumentation for the [uploader](https://github.com/Cap-go/capacitor-uploader)\n\n```typescript\n  import { CameraPreview } from '@capgo/camera-preview'\n  import { Uploader } from '@capgo/capacitor-uploader';\n\n\n  async function record() {\n    await CameraPreview.startRecordVideo({ storeToFile: true })\n    await new Promise(resolve =\u003e setTimeout(resolve, 5000))\n    const fileUrl = await CameraPreview.stopRecordVideo()\n    console.log(fileUrl.videoFilePath)\n    await uploadVideo(fileUrl.videoFilePath)\n  }\n\n  async function uploadVideo(filePath: string) {\n    Uploader.addListener('events', (event) =\u003e {\n      switch (event.name) {\n        case 'uploading':\n          console.log(`Upload progress: ${event.payload.percent}%`);\n          break;\n        case 'completed':\n          console.log('Upload completed successfully');\n          console.log('Server response status code:', event.payload.statusCode);\n          break;\n        case 'failed':\n          console.error('Upload failed:', event.payload.error);\n          break;\n      }\n    });\n    try {\n      const result = await Uploader.startUpload({\n        filePath,\n        serverUrl: 'S#_PRESIGNED_URL',\n        method: 'PUT',\n        headers: {\n          'Content-Type': 'video/mp4',\n        },\n        mimeType: 'video/mp4',\n      });\n      console.log('Video uploaded successfully:', result.id);\n    } catch (error) {\n      console.error('Error uploading video:', error);\n      throw error;\n    }\n  }\n```\n\n### API\n\n\u003cdocgen-index\u003e\n\n* [`start(...)`](#start)\n* [`stop(...)`](#stop)\n* [`capture(...)`](#capture)\n* [`captureSample(...)`](#capturesample)\n* [`getSupportedFlashModes()`](#getsupportedflashmodes)\n* [`setAspectRatio(...)`](#setaspectratio)\n* [`getAspectRatio()`](#getaspectratio)\n* [`setGridMode(...)`](#setgridmode)\n* [`getGridMode()`](#getgridmode)\n* [`checkPermissions(...)`](#checkpermissions)\n* [`requestPermissions(...)`](#requestpermissions)\n* [`getHorizontalFov()`](#gethorizontalfov)\n* [`getSupportedPictureSizes()`](#getsupportedpicturesizes)\n* [`setFlashMode(...)`](#setflashmode)\n* [`flip()`](#flip)\n* [`setOpacity(...)`](#setopacity)\n* [`stopRecordVideo()`](#stoprecordvideo)\n* [`startRecordVideo(...)`](#startrecordvideo)\n* [`isRunning()`](#isrunning)\n* [`getAvailableDevices()`](#getavailabledevices)\n* [`getZoom()`](#getzoom)\n* [`getZoomButtonValues()`](#getzoombuttonvalues)\n* [`setZoom(...)`](#setzoom)\n* [`getFlashMode()`](#getflashmode)\n* [`removeAllListeners()`](#removealllisteners)\n* [`setDeviceId(...)`](#setdeviceid)\n* [`getDeviceId()`](#getdeviceid)\n* [`getPreviewSize()`](#getpreviewsize)\n* [`setPreviewSize(...)`](#setpreviewsize)\n* [`setFocus(...)`](#setfocus)\n* [`addListener('screenResize', ...)`](#addlistenerscreenresize-)\n* [`addListener('orientationChange', ...)`](#addlistenerorientationchange-)\n* [`deleteFile(...)`](#deletefile)\n* [`getSafeAreaInsets()`](#getsafeareainsets)\n* [`getOrientation()`](#getorientation)\n* [`getExposureModes()`](#getexposuremodes)\n* [`getExposureMode()`](#getexposuremode)\n* [`setExposureMode(...)`](#setexposuremode)\n* [`getExposureCompensationRange()`](#getexposurecompensationrange)\n* [`getExposureCompensation()`](#getexposurecompensation)\n* [`setExposureCompensation(...)`](#setexposurecompensation)\n* [`getPluginVersion()`](#getpluginversion)\n* [Interfaces](#interfaces)\n* [Type Aliases](#type-aliases)\n* [Enums](#enums)\n\n\u003c/docgen-index\u003e\n\n\u003cdocgen-api\u003e\n\u003c!--Update the source file JSDoc comments and rerun docgen to update the docs below--\u003e\n\nThe main interface for the CameraPreview plugin.\n\n### start(...)\n\n```typescript\nstart(options: CameraPreviewOptions) =\u003e Promise\u003c{ width: number; height: number; x: number; y: number; }\u003e\n```\n\nStarts the camera preview.\n\n| Param         | Type                                                                  | Description                                 |\n| ------------- | --------------------------------------------------------------------- | ------------------------------------------- |\n| **`options`** | \u003ccode\u003e\u003ca href=\"#camerapreviewoptions\"\u003eCameraPreviewOptions\u003c/a\u003e\u003c/code\u003e | - The configuration for the camera preview. |\n\n**Returns:** \u003ccode\u003ePromise\u0026lt;{ width: number; height: number; x: number; y: number; }\u0026gt;\u003c/code\u003e\n\n**Since:** 0.0.1\n\n--------------------\n\n\n### stop(...)\n\n```typescript\nstop(options?: { force?: boolean | undefined; } | undefined) =\u003e Promise\u003cvoid\u003e\n```\n\nStops the camera preview.\n\n| Param         | Type                              | Description                                       |\n| ------------- | --------------------------------- | ------------------------------------------------- |\n| **`options`** | \u003ccode\u003e{ force?: boolean; }\u003c/code\u003e | - Optional configuration for stopping the camera. |\n\n**Since:** 0.0.1\n\n--------------------\n\n\n### capture(...)\n\n```typescript\ncapture(options: CameraPreviewPictureOptions) =\u003e Promise\u003c{ value: string; exif: ExifData; }\u003e\n```\n\nCaptures a picture from the camera.\n\nIf `storeToFile` was set to `true` when starting the preview, the returned\n`value` will be an absolute file path on the device instead of a base64 string. Use getBase64FromFilePath to get the base64 string from the file path.\n\n| Param         | Type                                                                                | Description                              |\n| ------------- | ----------------------------------------------------------------------------------- | ---------------------------------------- |\n| **`options`** | \u003ccode\u003e\u003ca href=\"#camerapreviewpictureoptions\"\u003eCameraPreviewPictureOptions\u003c/a\u003e\u003c/code\u003e | - The options for capturing the picture. |\n\n**Returns:** \u003ccode\u003ePromise\u0026lt;{ value: string; exif: \u003ca href=\"#exifdata\"\u003eExifData\u003c/a\u003e; }\u0026gt;\u003c/code\u003e\n\n**Since:** 0.0.1\n\n--------------------\n\n\n### captureSample(...)\n\n```typescript\ncaptureSample(options: CameraSampleOptions) =\u003e Promise\u003c{ value: string; }\u003e\n```\n\nCaptures a single frame from the camera preview stream.\n\n| Param         | Type                                                                | Description                             |\n| ------------- | ------------------------------------------------------------------- | --------------------------------------- |\n| **`options`** | \u003ccode\u003e\u003ca href=\"#camerasampleoptions\"\u003eCameraSampleOptions\u003c/a\u003e\u003c/code\u003e | - The options for capturing the sample. |\n\n**Returns:** \u003ccode\u003ePromise\u0026lt;{ value: string; }\u0026gt;\u003c/code\u003e\n\n**Since:** 0.0.1\n\n--------------------\n\n\n### getSupportedFlashModes()\n\n```typescript\ngetSupportedFlashModes() =\u003e Promise\u003c{ result: CameraPreviewFlashMode[]; }\u003e\n```\n\nGets the flash modes supported by the active camera.\n\n**Returns:** \u003ccode\u003ePromise\u0026lt;{ result: CameraPreviewFlashMode[]; }\u0026gt;\u003c/code\u003e\n\n**Since:** 0.0.1\n\n--------------------\n\n\n### setAspectRatio(...)\n\n```typescript\nsetAspectRatio(options: { aspectRatio: '4:3' | '16:9'; x?: number; y?: number; }) =\u003e Promise\u003c{ width: number; height: number; x: number; y: number; }\u003e\n```\n\nSet the aspect ratio of the camera preview.\n\n| Param         | Type                                                                   | Description                                                                                                                                                                                                                                                                                                           |\n| ------------- | ---------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| **`options`** | \u003ccode\u003e{ aspectRatio: '4:3' \\| '16:9'; x?: number; y?: number; }\u003c/code\u003e | - The desired aspect ratio and optional position. - aspectRatio: The desired aspect ratio ('4:3' or '16:9') - x: Optional x coordinate for positioning. If not provided, view will be auto-centered horizontally. - y: Optional y coordinate for positioning. If not provided, view will be auto-centered vertically. |\n\n**Returns:** \u003ccode\u003ePromise\u0026lt;{ width: number; height: number; x: number; y: number; }\u0026gt;\u003c/code\u003e\n\n**Since:** 7.5.0\n\n--------------------\n\n\n### getAspectRatio()\n\n```typescript\ngetAspectRatio() =\u003e Promise\u003c{ aspectRatio: '4:3' | '16:9'; }\u003e\n```\n\nGets the current aspect ratio of the camera preview.\n\n**Returns:** \u003ccode\u003ePromise\u0026lt;{ aspectRatio: '4:3' | '16:9'; }\u0026gt;\u003c/code\u003e\n\n**Since:** 7.5.0\n\n--------------------\n\n\n### setGridMode(...)\n\n```typescript\nsetGridMode(options: { gridMode: GridMode; }) =\u003e Promise\u003cvoid\u003e\n```\n\nSets the grid mode of the camera preview overlay.\n\n| Param         | Type                                                         | Description                                        |\n| ------------- | ------------------------------------------------------------ | -------------------------------------------------- |\n| **`options`** | \u003ccode\u003e{ gridMode: \u003ca href=\"#gridmode\"\u003eGridMode\u003c/a\u003e; }\u003c/code\u003e | - The desired grid mode ('none', '3x3', or '4x4'). |\n\n**Since:** 8.0.0\n\n--------------------\n\n\n### getGridMode()\n\n```typescript\ngetGridMode() =\u003e Promise\u003c{ gridMode: GridMode; }\u003e\n```\n\nGets the current grid mode of the camera preview overlay.\n\n**Returns:** \u003ccode\u003ePromise\u0026lt;{ gridMode: \u003ca href=\"#gridmode\"\u003eGridMode\u003c/a\u003e; }\u0026gt;\u003c/code\u003e\n\n**Since:** 8.0.0\n\n--------------------\n\n\n### checkPermissions(...)\n\n```typescript\ncheckPermissions(options?: Pick\u003cPermissionRequestOptions, \"disableAudio\"\u003e | undefined) =\u003e Promise\u003cCameraPermissionStatus\u003e\n```\n\nChecks the current camera (and optionally microphone) permission status without prompting the system dialog.\n\n| Param         | Type                                                                                                                          | Description                                                                           |\n| ------------- | ----------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- |\n| **`options`** | \u003ccode\u003e\u003ca href=\"#pick\"\u003ePick\u003c/a\u003e\u0026lt;\u003ca href=\"#permissionrequestoptions\"\u003ePermissionRequestOptions\u003c/a\u003e, 'disableAudio'\u0026gt;\u003c/code\u003e | Set `disableAudio` to `false` to also include microphone status (defaults to `true`). |\n\n**Returns:** \u003ccode\u003ePromise\u0026lt;\u003ca href=\"#camerapermissionstatus\"\u003eCameraPermissionStatus\u003c/a\u003e\u0026gt;\u003c/code\u003e\n\n**Since:** 8.7.0\n\n--------------------\n\n\n### requestPermissions(...)\n\n```typescript\nrequestPermissions(options?: PermissionRequestOptions | undefined) =\u003e Promise\u003cCameraPermissionStatus\u003e\n```\n\nRequests camera (and optional microphone) permissions. If permissions are already granted or denied,\nthe current status is returned without prompting. When `showSettingsAlert` is true and permissions are denied,\na platform specific alert guiding the user to the app settings will be presented.\n\n| Param         | Type                                                                          | Description                                           |\n| ------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------- |\n| **`options`** | \u003ccode\u003e\u003ca href=\"#permissionrequestoptions\"\u003ePermissionRequestOptions\u003c/a\u003e\u003c/code\u003e | - Configuration for the permission request behaviour. |\n\n**Returns:** \u003ccode\u003ePromise\u0026lt;\u003ca href=\"#camerapermissionstatus\"\u003eCameraPermissionStatus\u003c/a\u003e\u0026gt;\u003c/code\u003e\n\n**Since:** 8.7.0\n\n--------------------\n\n\n### getHorizontalFov()\n\n```typescript\ngetHorizontalFov() =\u003e Promise\u003c{ result: number; }\u003e\n```\n\nGets the horizontal field of view (FoV) for the active camera.\nNote: This can be an estimate on some devices.\n\n**Returns:** \u003ccode\u003ePromise\u0026lt;{ result: number; }\u0026gt;\u003c/code\u003e\n\n**Since:** 0.0.1\n\n--------------------\n\n\n### getSupportedPictureSizes()\n\n```typescript\ngetSupportedPictureSizes() =\u003e Promise\u003c{ supportedPictureSizes: SupportedPictureSizes[]; }\u003e\n```\n\nGets the supported picture sizes for all cameras.\n\n**Returns:** \u003ccode\u003ePromise\u0026lt;{ supportedPictureSizes: SupportedPictureSizes[]; }\u0026gt;\u003c/code\u003e\n\n**Since:** 7.4.0\n\n--------------------\n\n\n### setFlashMode(...)\n\n```typescript\nsetFlashMode(options: { flashMode: CameraPreviewFlashMode | string; }) =\u003e Promise\u003cvoid\u003e\n```\n\nSets the flash mode for the active camera.\n\n| Param         | Type                                | Description               |\n| ------------- | ----------------------------------- | ------------------------- |\n| **`options`** | \u003ccode\u003e{ flashMode: string; }\u003c/code\u003e | - The desired flash mode. |\n\n**Since:** 0.0.1\n\n--------------------\n\n\n### flip()\n\n```typescript\nflip() =\u003e Promise\u003cvoid\u003e\n```\n\nToggles between the front and rear cameras.\n\n**Since:** 0.0.1\n\n--------------------\n\n\n### setOpacity(...)\n\n```typescript\nsetOpacity(options: CameraOpacityOptions) =\u003e Promise\u003cvoid\u003e\n```\n\nSets the opacity of the camera preview.\n\n| Param         | Type                                                                  | Description            |\n| ------------- | --------------------------------------------------------------------- | ---------------------- |\n| **`options`** | \u003ccode\u003e\u003ca href=\"#cameraopacityoptions\"\u003eCameraOpacityOptions\u003c/a\u003e\u003c/code\u003e | - The opacity options. |\n\n**Since:** 0.0.1\n\n--------------------\n\n\n### stopRecordVideo()\n\n```typescript\nstopRecordVideo() =\u003e Promise\u003c{ videoFilePath: string; }\u003e\n```\n\nStops an ongoing video recording.\n\n**Returns:** \u003ccode\u003ePromise\u0026lt;{ videoFilePath: string; }\u0026gt;\u003c/code\u003e\n\n**Since:** 0.0.1\n\n--------------------\n\n\n### startRecordVideo(...)\n\n```typescript\nstartRecordVideo(options: CameraPreviewOptions) =\u003e Promise\u003cvoid\u003e\n```\n\nStarts recording a video.\n\n| Param         | Type                                                                  | Description                                  |\n| ------------- | --------------------------------------------------------------------- | -------------------------------------------- |\n| **`options`** | \u003ccode\u003e\u003ca href=\"#camerapreviewoptions\"\u003eCameraPreviewOptions\u003c/a\u003e\u003c/code\u003e | - The options for video recording. Only iOS. |\n\n**Since:** 0.0.1\n\n--------------------\n\n\n### isRunning()\n\n```typescript\nisRunning() =\u003e Promise\u003c{ isRunning: boolean; }\u003e\n```\n\nChecks if the camera preview is currently running.\n\n**Returns:** \u003ccode\u003ePromise\u0026lt;{ isRunning: boolean; }\u0026gt;\u003c/code\u003e\n\n**Since:** 7.5.0\n\n--------------------\n\n\n### getAvailableDevices()\n\n```typescript\ngetAvailableDevices() =\u003e Promise\u003c{ devices: CameraDevice[]; }\u003e\n```\n\nGets all available camera devices.\n\n**Returns:** \u003ccode\u003ePromise\u0026lt;{ devices: CameraDevice[]; }\u0026gt;\u003c/code\u003e\n\n**Since:** 7.5.0\n\n--------------------\n\n\n### getZoom()\n\n```typescript\ngetZoom() =\u003e Promise\u003c{ min: number; max: number; current: number; lens: LensInfo; }\u003e\n```\n\nGets the current zoom state, including min/max and current lens info.\n\n**Returns:** \u003ccode\u003ePromise\u0026lt;{ min: number; max: number; current: number; lens: \u003ca href=\"#lensinfo\"\u003eLensInfo\u003c/a\u003e; }\u0026gt;\u003c/code\u003e\n\n**Since:** 7.5.0\n\n--------------------\n\n\n### getZoomButtonValues()\n\n```typescript\ngetZoomButtonValues() =\u003e Promise\u003c{ values: number[]; }\u003e\n```\n\nReturns zoom button values for quick switching.\n- iOS/Android: includes 0.5 if ultra-wide available; 1 and 2 if wide available; 3 if telephoto available\n- Web: unsupported\n\n**Returns:** \u003ccode\u003ePromise\u0026lt;{ values: number[]; }\u0026gt;\u003c/code\u003e\n\n**Since:** 7.5.0\n\n--------------------\n\n\n### setZoom(...)\n\n```typescript\nsetZoom(options: { level: number; ramp?: boolean; autoFocus?: boolean; }) =\u003e Promise\u003cvoid\u003e\n```\n\nSets the zoom level of the camera.\n\n| Param         | Type                                                                 | Description                                                                         |\n| ------------- | -------------------------------------------------------------------- | ----------------------------------------------------------------------------------- |\n| **`options`** | \u003ccode\u003e{ level: number; ramp?: boolean; autoFocus?: boolean; }\u003c/code\u003e | - The desired zoom level. `ramp` is currently unused. `autoFocus` defaults to true. |\n\n**Since:** 7.5.0\n\n--------------------\n\n\n### getFlashMode()\n\n```typescript\ngetFlashMode() =\u003e Promise\u003c{ flashMode: FlashMode; }\u003e\n```\n\nGets the current flash mode.\n\n**Returns:** \u003ccode\u003ePromise\u0026lt;{ flashMode: \u003ca href=\"#camerapreviewflashmode\"\u003eCameraPreviewFlashMode\u003c/a\u003e; }\u0026gt;\u003c/code\u003e\n\n**Since:** 7.5.0\n\n--------------------\n\n\n### removeAllListeners()\n\n```typescript\nremoveAllListeners() =\u003e Promise\u003cvoid\u003e\n```\n\nRemoves all registered listeners.\n\n**Since:** 7.5.0\n\n--------------------\n\n\n### setDeviceId(...)\n\n```typescript\nsetDeviceId(options: { deviceId: string; }) =\u003e Promise\u003cvoid\u003e\n```\n\nSwitches the active camera to the one with the specified `deviceId`.\n\n| Param         | Type                               | Description                          |\n| ------------- | ---------------------------------- | ------------------------------------ |\n| **`options`** | \u003ccode\u003e{ deviceId: string; }\u003c/code\u003e | - The ID of the device to switch to. |\n\n**Since:** 7.5.0\n\n--------------------\n\n\n### getDeviceId()\n\n```typescript\ngetDeviceId() =\u003e Promise\u003c{ deviceId: string; }\u003e\n```\n\nGets the ID of the camera device that is currently bound.\nOn Android, if a physical-lens request falls back to a logical camera, this returns the bound logical camera ID.\n\n**Returns:** \u003ccode\u003ePromise\u0026lt;{ deviceId: string; }\u0026gt;\u003c/code\u003e\n\n**Since:** 7.5.0\n\n--------------------\n\n\n### getPreviewSize()\n\n```typescript\ngetPreviewSize() =\u003e Promise\u003c{ x: number; y: number; width: number; height: number; }\u003e\n```\n\nGets the current preview size and position.\n\n**Returns:** \u003ccode\u003ePromise\u0026lt;{ x: number; y: number; width: number; height: number; }\u0026gt;\u003c/code\u003e\n\n**Since:** 7.5.0\n\n--------------------\n\n\n### setPreviewSize(...)\n\n```typescript\nsetPreviewSize(options: { x?: number; y?: number; width: number; height: number; }) =\u003e Promise\u003c{ width: number; height: number; x: number; y: number; }\u003e\n```\n\nSets the preview size and position.\n\n| Param         | Type                                                                    | Description                      |\n| ------------- | ----------------------------------------------------------------------- | -------------------------------- |\n| **`options`** | \u003ccode\u003e{ x?: number; y?: number; width: number; height: number; }\u003c/code\u003e | The new position and dimensions. |\n\n**Returns:** \u003ccode\u003ePromise\u0026lt;{ width: number; height: number; x: number; y: number; }\u0026gt;\u003c/code\u003e\n\n**Since:** 7.5.0\n\n--------------------\n\n\n### setFocus(...)\n\n```typescript\nsetFocus(options: { x: number; y: number; }) =\u003e Promise\u003cvoid\u003e\n```\n\nSets the camera focus to a specific point in the preview.\n\nNote: The plugin does not attach any native tap-to-focus gesture handlers. Handle taps in\nyour HTML/JS (e.g., on the overlaying UI), then pass normalized coordinates here.\n\n| Param         | Type                                   | Description          |\n| ------------- | -------------------------------------- | -------------------- |\n| **`options`** | \u003ccode\u003e{ x: number; y: number; }\u003c/code\u003e | - The focus options. |\n\n**Since:** 7.5.0\n\n--------------------\n\n\n### addListener('screenResize', ...)\n\n```typescript\naddListener(eventName: 'screenResize', listenerFunc: (data: { width: number; height: number; x: number; y: number; }) =\u003e void) =\u003e Promise\u003cPluginListenerHandle\u003e\n```\n\nAdds a listener for screen resize events.\n\n| Param              | Type                                                                                     | Description                                         |\n| ------------------ | ---------------------------------------------------------------------------------------- | --------------------------------------------------- |\n| **`eventName`**    | \u003ccode\u003e'screenResize'\u003c/code\u003e                                                              | - The event name to listen for.                     |\n| **`listenerFunc`** | \u003ccode\u003e(data: { width: number; height: number; x: number; y: number; }) =\u0026gt; void\u003c/code\u003e | - The function to call when the event is triggered. |\n\n**Returns:** \u003ccode\u003ePromise\u0026lt;\u003ca href=\"#pluginlistenerhandle\"\u003ePluginListenerHandle\u003c/a\u003e\u0026gt;\u003c/code\u003e\n\n**Since:** 7.5.0\n\n--------------------\n\n\n### addListener('orientationChange', ...)\n\n```typescript\naddListener(eventName: 'orientationChange', listenerFunc: (data: { orientation: DeviceOrientation; }) =\u003e void) =\u003e Promise\u003cPluginListenerHandle\u003e\n```\n\nAdds a listener for orientation change events.\n\n| Param              | Type                                                                                                 | Description                                         |\n| ------------------ | ---------------------------------------------------------------------------------------------------- | --------------------------------------------------- |\n| **`eventName`**    | \u003ccode\u003e'orientationChange'\u003c/code\u003e                                                                     | - The event name to listen for.                     |\n| **`listenerFunc`** | \u003ccode\u003e(data: { orientation: \u003ca href=\"#deviceorientation\"\u003eDeviceOrientation\u003c/a\u003e; }) =\u0026gt; void\u003c/code\u003e | - The function to call when the event is triggered. |\n\n**Returns:** \u003ccode\u003ePromise\u0026lt;\u003ca href=\"#pluginlistenerhandle\"\u003ePluginListenerHandle\u003c/a\u003e\u0026gt;\u003c/code\u003e\n\n**Since:** 7.5.0\n\n--------------------\n\n\n### deleteFile(...)\n\n```typescript\ndeleteFile(options: { path: string; }) =\u003e Promise\u003c{ success: boolean; }\u003e\n```\n\nDeletes a file at the given absolute path on the device.\nUse this to quickly clean up temporary images created with `storeToFile`.\nOn web, this is not supported and will throw.\n\n| Param         | Type                           |\n| ------------- | ------------------------------ |\n| **`options`** | \u003ccode\u003e{ path: string; }\u003c/code\u003e |\n\n**Returns:** \u003ccode\u003ePromise\u0026lt;{ success: boolean; }\u0026gt;\u003c/code\u003e\n\n**Since:** 7.5.0\n\n--------------------\n\n\n### getSafeAreaInsets()\n\n```typescript\ngetSafeAreaInsets() =\u003e Promise\u003cSafeAreaInsets\u003e\n```\n\nGets the safe area insets for devices.\nReturns the orientation-aware notch/camera cutout inset and the current orientation.\nIn portrait mode: returns top inset (notch at top).\nIn landscape mode: returns left inset (notch moved to side).\nThis specifically targets the cutout area (notch, punch hole, etc.) that all modern phones have.\n\nAndroid: Values returned in dp (logical pixels).\niOS: Values returned in physical pixels, excluding status bar (only pure notch/cutout size).\n\n**Returns:** \u003ccode\u003ePromise\u0026lt;\u003ca href=\"#safeareainsets\"\u003eSafeAreaInsets\u003c/a\u003e\u0026gt;\u003c/code\u003e\n\n--------------------\n\n\n### getOrientation()\n\n```typescript\ngetOrientation() =\u003e Promise\u003c{ orientation: DeviceOrientation; }\u003e\n```\n\nGets the current device orientation in a cross-platform format.\n\n**Returns:** \u003ccode\u003ePromise\u0026lt;{ orientation: \u003ca href=\"#deviceorientation\"\u003eDeviceOrientation\u003c/a\u003e; }\u0026gt;\u003c/code\u003e\n\n**Since:** 7.5.0\n\n--------------------\n\n\n### getExposureModes()\n\n```typescript\ngetExposureModes() =\u003e Promise\u003c{ modes: ExposureMode[]; }\u003e\n```\n\nReturns the exposure modes supported by the active camera.\nModes can include: 'locked', 'auto', 'continuous', 'custom'.\n\n**Returns:** \u003ccode\u003ePromise\u0026lt;{ modes: ExposureMode[]; }\u0026gt;\u003c/code\u003e\n\n--------------------\n\n\n### getExposureMode()\n\n```typescript\ngetExposureMode() =\u003e Promise\u003c{ mode: ExposureMode; }\u003e\n```\n\nReturns the current exposure mode.\n\n**Returns:** \u003ccode\u003ePromise\u0026lt;{ mode: \u003ca href=\"#exposuremode\"\u003eExposureMode\u003c/a\u003e; }\u0026gt;\u003c/code\u003e\n\n--------------------\n\n\n### setExposureMode(...)\n\n```typescript\nsetExposureMode(options: { mode: ExposureMode; }) =\u003e Promise\u003cvoid\u003e\n```\n\nSets the exposure mode.\n\n| Param         | Type                                                             |\n| ------------- | ---------------------------------------------------------------- |\n| **`options`** | \u003ccode\u003e{ mode: \u003ca href=\"#exposuremode\"\u003eExposureMode\u003c/a\u003e; }\u003c/code\u003e |\n\n--------------------\n\n\n### getExposureCompensationRange()\n\n```typescript\ngetExposureCompensationRange() =\u003e Promise\u003c{ min: number; max: number; step: number; }\u003e\n```\n\nReturns the exposure compensation (EV bias) supported range.\n\n**Returns:** \u003ccode\u003ePromise\u0026lt;{ min: number; max: number; step: number; }\u0026gt;\u003c/code\u003e\n\n--------------------\n\n\n### getExposureCompensation()\n\n```typescript\ngetExposureCompensation() =\u003e Promise\u003c{ value: number; }\u003e\n```\n\nReturns the current exposure compensation (EV bias).\n\n**Returns:** \u003ccode\u003ePromise\u0026lt;{ value: number; }\u0026gt;\u003c/code\u003e\n\n--------------------\n\n\n### setExposureCompensation(...)\n\n```typescript\nsetExposureCompensation(options: { value: number; }) =\u003e Promise\u003cvoid\u003e\n```\n\nSets the exposure compensation (EV bias). Value will be clamped to range.\n\n| Param         | Type                            |\n| ------------- | ------------------------------- |\n| **`options`** | \u003ccode\u003e{ value: number; }\u003c/code\u003e |\n\n--------------------\n\n\n### getPluginVersion()\n\n```typescript\ngetPluginVersion() =\u003e Promise\u003c{ version: string; }\u003e\n```\n\nGet the native Capacitor plugin version\n\n**Returns:** \u003ccode\u003ePromise\u0026lt;{ version: string; }\u0026gt;\u003c/code\u003e\n\n--------------------\n\n\n### Interfaces\n\n\n#### CameraPreviewOptions\n\nDefines the configuration options for starting the camera preview.\n\n| Prop                                | Type                                                            | Description                                                                                                                                                                                                                         | Default                | Since  |\n| ----------------------------------- | --------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------- | ------ |\n| **`parent`**                        | \u003ccode\u003estring\u003c/code\u003e                                             | The parent element to attach the video preview to.                                                                                                                                                                                  |                        |        |\n| **`className`**                     | \u003ccode\u003estring\u003c/code\u003e                                             | A CSS class name to add to the preview element.                                                                                                                                                                                     |                        |        |\n| **`width`**                         | \u003ccode\u003enumber\u003c/code\u003e                                             | The width of the preview in pixels. Defaults to the screen width.                                                                                                                                                                   |                        |        |\n| **`height`**                        | \u003ccode\u003enumber\u003c/code\u003e                                             | The height of the preview in pixels. Defaults to the screen height.                                                                                                                                                                 |                        |        |\n| **`x`**                             | \u003ccode\u003enumber\u003c/code\u003e                                             | The horizontal origin of the preview, in pixels.                                                                                                                                                                                    |                        |        |\n| **`y`**                             | \u003ccode\u003enumber\u003c/code\u003e                                             | The vertical origin of the preview, in pixels.                                                                                                                                                                                      |                        |        |\n| **`aspectRatio`**                   | \u003ccode\u003e'4:3' \\| '16:9'\u003c/code\u003e                                    | The aspect ratio of the camera preview, '4:3' or '16:9' or 'fill'. Cannot be set if width or height is provided, otherwise the call will be rejected. Use setPreviewSize to adjust size after starting.                             |                        | 2.0.0  |\n| **`aspectMode`**                    | \u003ccode\u003e'cover' \\| 'contain'\u003c/code\u003e                               | Controls how the camera preview fills the available space. - 'contain': Fits the entire preview within the space, may show letterboxing (default). - 'cover': Fills the entire space, may crop edges of the preview.                | \u003ccode\u003e\"contain\"\u003c/code\u003e |        |\n| **`gridMode`**                      | \u003ccode\u003e\u003ca href=\"#gridmode\"\u003eGridMode\u003c/a\u003e\u003c/code\u003e                   | The grid overlay to display on the camera preview.                                                                                                                                                                                  | \u003ccode\u003e\"none\"\u003c/code\u003e    | 2.1.0  |\n| **`includeSafeAreaInsets`**         | \u003ccode\u003eboolean\u003c/code\u003e                                            | Adjusts the y-position to account for safe areas (e.g., notches).                                                                                                                                                                   | \u003ccode\u003efalse\u003c/code\u003e     |        |\n| **`toBack`**                        | \u003ccode\u003eboolean\u003c/code\u003e                                            | If true, places the preview behind the webview.                                                                                                                                                                                     | \u003ccode\u003etrue\u003c/code\u003e      |        |\n| **`paddingBottom`**                 | \u003ccode\u003enumber\u003c/code\u003e                                             | Bottom padding for the preview, in pixels.                                                                                                                                                                                          |                        |        |\n| **`rotateWhenOrientationChanged`**  | \u003ccode\u003eboolean\u003c/code\u003e                                            | Whether to rotate the preview when the device orientation changes.                                                                                                                                                                  | \u003ccode\u003etrue\u003c/code\u003e      |        |\n| **`position`**                      | \u003ccode\u003estring\u003c/code\u003e                                             | The camera to use.                                                                                                                                                                                                                  | \u003ccode\u003e\"rear\"\u003c/code\u003e    |        |\n| **`storeToFile`**                   | \u003ccode\u003eboolean\u003c/code\u003e                                            | If true, saves the captured image to a file and returns the file path. If false, returns a base64 encoded string.                                                                                                                   | \u003ccode\u003efalse\u003c/code\u003e     |        |\n| **`disableExifHeaderStripping`**    | \u003ccode\u003eboolean\u003c/code\u003e                                            | If true, prevents the plugin from rotating the image based on EXIF data.                                                                                                                                                            | \u003ccode\u003efalse\u003c/code\u003e     |        |\n| **`disableAudio`**                  | \u003ccode\u003eboolean\u003c/code\u003e                                            | If true, disables the audio stream, preventing audio permission requests.                                                                                                                                                           | \u003ccode\u003etrue\u003c/code\u003e      |        |\n| **`lockAndroidOrientation`**        | \u003ccode\u003eboolean\u003c/code\u003e                                            | If true, locks the device orientation while the camera is active.                                                                                                                                                                   | \u003ccode\u003efalse\u003c/code\u003e     |        |\n| **`enableOpacity`**                 | \u003ccode\u003eboolean\u003c/code\u003e                                            | If true, allows the camera preview's opacity to be changed.                                                                                                                                                                         | \u003ccode\u003efalse\u003c/code\u003e     |        |\n| **`disableFocusIndicator`**         | \u003ccode\u003eboolean\u003c/code\u003e                                            | If true, disables the visual focus indicator when tapping to focus.                                                                                                                                                                 | \u003ccode\u003efalse\u003c/code\u003e     |        |\n| **`deviceId`**                      | \u003ccode\u003estring\u003c/code\u003e                                             | The `deviceId` of the camera to use. If provided, `position` is ignored.                                                                                                                                                            |                        |        |\n| **`enablePhysicalDeviceSelection`** | \u003ccode\u003eboolean\u003c/code\u003e                                            | On Android, attempts to bind a physical camera directly when `deviceId` refers to a physical lens. Disabled by default because OEM support is inconsistent; when false, Android keeps the current logical-camera fallback behavior. | \u003ccode\u003efalse\u003c/code\u003e     |        |\n| **`initialZoomLevel`**              | \u003ccode\u003enumber\u003c/code\u003e                                             | The initial zoom level when starting the camera preview. If the requested zoom level is not available, the native plugin will reject.                                                                                               | \u003ccode\u003e1.0\u003c/code\u003e       | 2.2.0  |\n| **`positioning`**                   | \u003ccode\u003e\u003ca href=\"#camerapositioning\"\u003eCameraPositioning\u003c/a\u003e\u003c/code\u003e | The vertical positioning of the camera preview.                                                                                                                                                                                     | \u003ccode\u003e\"center\"\u003c/code\u003e  | 2.3.0  |\n| **`enableVideoMode`**               | \u003ccode\u003eboolean\u003c/code\u003e                                            | If true, enables video capture capabilities when the camera starts.                                                                                                                                                                 | \u003ccode\u003efalse\u003c/code\u003e     | 7.11.0 |\n| **`force`**                         | \u003ccode\u003eboolean\u003c/code\u003e                                            | If true, forces the camera to start/restart even if it's already running or busy. This will kill the current camera session and start a new one, ignoring all state checks.                                                         | \u003ccode\u003efalse\u003c/code\u003e     |        |\n| **`videoQuality`**                  | \u003ccode\u003e'low' \\| 'medium' \\| 'high'\u003c/code\u003e                        | Sets the quality of video for recording. Options: 'low', 'medium', 'high'                                                                                                                                                           | \u003ccode\u003e\"high\"\u003c/code\u003e    |        |\n\n\n#### ExifData\n\nRepresents EXIF data extracted from an image.\n\n\n#### CameraPreviewPictureOptions\n\nDefines the options for capturing a picture.\n\n| Prop                             | Type                                                    | Description                                                                                                                                                                                                                                                                                                                                                                           | Default              | Since  |\n| -------------------------------- | ------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------- | ------ |\n| **`height`**                     | \u003ccode\u003enumber\u003c/code\u003e                                     | The maximum height of the picture in pixels. The image will be resized to fit within this height while maintaining aspect ratio. If not specified the captured image will match the preview's visible area.                                                                                                                                                                           |                      |        |\n| **`width`**                      | \u003ccode\u003enumber\u003c/code\u003e                                     | The maximum width of the picture in pixels. The image will be resized to fit within this width while maintaining aspect ratio. If not specified the captured image will match the preview's visible area.                                                                                                                                                                             |                      |        |\n| **`quality`**                    | \u003ccode\u003enumber\u003c/code\u003e                                     | The quality of the captured image, from 0 to 100. Does not apply to `png` format.                                                                                                                                                                                                                                                                                                     | \u003ccode\u003e85\u003c/code\u003e      |        |\n| **`format`**                     | \u003ccode\u003e\u003ca href=\"#pictureformat\"\u003ePictureFormat\u003c/a\u003e\u003c/code\u003e | The format of the captured image.                                                                                                                                                                                                                                                                                                                                                     | \u003ccode\u003e\"jpeg\"\u003c/code\u003e  |        |\n| **`saveToGallery`**              | \u003ccode\u003eboolean\u003c/code\u003e                                    | If true, the captured image will be saved to the user's gallery.                                                                                                                                                                                                                                                                                                                      | \u003ccode\u003efalse\u003c/code\u003e   | 7.5.0  |\n| **`withExifLocation`**           | \u003ccode\u003eboolean\u003c/code\u003e                                    | If true, the plugin will attempt to add GPS location data to the image's EXIF metadata. This may prompt the user for location permissions.                                                                                                                                                                                                                                            | \u003ccode\u003efalse\u003c/code\u003e   | 7.6.0  |\n| **`embedTimestamp`**             | \u003ccode\u003eboolean\u003c/code\u003e                                    | If true, the plugin will embed a timestamp in the top-right corner of the image.                                                                                                                                                                                                                                                                                                      | \u003ccode\u003efalse\u003c/code\u003e   | 7.17.0 |\n| **`embedLocation`**              | \u003ccode\u003eboolean\u003c/code\u003e                                    | If true, the plugin will embed the current location in the top-right corner of the image. Requires `withExifLocation` to be enabled.                                                                                                                                                                                                                                                  | \u003ccode\u003efalse\u003c/code\u003e   | 7.18.0 |\n| **`photoQualityPrioritization`** | \u003ccode\u003e'speed' \\| 'balanced' \\| 'quality'\u003c/code\u003e         | Sets the priority for photo quality vs. capture speed. - \"speed\": Prioritizes faster capture times, may reduce image quality. - \"balanced\": Aims for a balance between quality and speed. - \"quality\": Prioritizes image quality, may reduce capture speed. See https://developer.apple.com/documentation/avfoundation/avcapturephotosettings/photoqualityprioritization for details. | \u003ccode\u003e\"speed\"\u003c/code\u003e | 7.21.0 |\n\n\n#### CameraSampleOptions\n\nDefines the options for capturing a sample frame from the camera preview.\n\n| Prop          | Type                | Description                                        | Default         |\n| ------------- | ------------------- | -------------------------------------------------- | --------------- |\n| **`quality`** | \u003ccode\u003enumber\u003c/code\u003e | The quality of the captured sample, from 0 to 100. | \u003ccode\u003e85\u003c/code\u003e |\n\n\n#### CameraPermissionStatus\n\n| Prop             | Type                                                        |\n| ---------------- | ----------------------------------------------------------- |\n| **`camera`**     | \u003ccode\u003e\u003ca href=\"#permissionstate\"\u003ePermissionState\u003c/a\u003e\u003c/code\u003e |\n| **`microphone`** | \u003ccode\u003e\u003ca href=\"#permissionstate\"\u003ePermissionState\u003c/a\u003e\u003c/code\u003e |\n\n\n#### PermissionRequestOptions\n\n| Prop                          | Type                 |\n| ----------------------------- | -------------------- |\n| **`disableAudio`**            | \u003ccode\u003eboolean\u003c/code\u003e |\n| **`showSettingsAlert`**       | \u003ccode\u003eboolean\u003c/code\u003e |\n| **`title`**                   | \u003ccode\u003estring\u003c/code\u003e  |\n| **`message`**                 | \u003ccode\u003estring\u003c/code\u003e  |\n| **`openSettingsButtonTitle`** | \u003ccode\u003estring\u003c/code\u003e  |\n| **`cancelButtonTitle`**       | \u003ccode\u003estring\u003c/code\u003e  |\n\n\n#### SupportedPictureSizes\n\nRepresents the supported picture sizes for a camera facing a certain direction.\n\n| Prop                        | Type                       | Description                                        |\n| --------------------------- | -------------------------- | -------------------------------------------------- |\n| **`facing`**                | \u003ccode\u003estring\u003c/code\u003e        | The camera direction (\"front\" or \"rear\").          |\n| **`supportedPictureSizes`** | \u003ccode\u003ePictureSize[]\u003c/code\u003e | A list of supported picture sizes for this camera. |\n\n\n#### PictureSize\n\nDefines a standard picture size with width and height.\n\n| Prop         | Type                | Description                          |\n| ------------ | ------------------- | ------------------------------------ |\n| **`width`**  | \u003ccode\u003enumber\u003c/code\u003e | The width of the picture in pixels.  |\n| **`height`** | \u003ccode\u003enumber\u003c/code\u003e | The height of the picture in pixels. |\n\n\n#### CameraOpacityOptions\n\nDefines the options for setting the camera preview's opacity.\n\n| Prop          | Type                | Description                                                                 | Default          |\n| ------------- | ------------------- | --------------------------------------------------------------------------- | ---------------- |\n| **`opacity`** | \u003ccode\u003enumber\u003c/code\u003e | The opacity percentage, from 0.0 (fully transparent) to 1.0 (fully opaque). | \u003ccode\u003e1.0\u003c/code\u003e |\n\n\n#### CameraDevice\n\nRepresents a physical camera on the device (e.g., the front-facing camera).\n\n| Prop            | Type                                                      | Description                                                                               |\n| --------------- | --------------------------------------------------------- | ----------------------------------------------------------------------------------------- |\n| **`deviceId`**  | \u003ccode\u003estring\u003c/code\u003e                                       | A unique identifier for the camera device.                                                |\n| **`label`**     | \u003ccode\u003estring\u003c/code\u003e                                       | A human-readable name for the camera device.                                              |\n| **`position`**  | \u003ccode\u003e\u003ca href=\"#cameraposition\"\u003eCameraPosition\u003c/a\u003e\u003c/code\u003e | The physical position of the camera on the device.                                        |\n| **`lenses`**    | \u003ccode\u003eCameraLens[]\u003c/code\u003e                                 | A list of all available lenses for this camera device.                                    |\n| **`minZoom`**   | \u003ccode\u003enumber\u003c/code\u003e                                       | The overall minimum zoom factor available across all lenses on this device.               |\n| **`maxZoom`**   | \u003ccode\u003enumber\u003c/code\u003e                                       | The overall maximum zoom factor available across all lenses on this device.               |\n| **`isLogical`** | \u003ccode\u003eboolean\u003c/code\u003e                                      | Identifies whether the device is a logical camera (composed of multiple physical lenses). |\n\n\n#### CameraLens\n\nRepresents a single camera lens on a device. A {@link \u003ca href=\"#cameradevice\"\u003eCameraDevice\u003c/a\u003e} can have multiple lenses.\n\n| Prop                | Type                                              | Description                                                                  |\n| ------------------- | ------------------------------------------------- | ---------------------------------------------------------------------------- |\n| **`label`**         | \u003ccode\u003estring\u003c/code\u003e                               | A human-readable name for the lens, e.g., \"Ultra-Wide\".                      |\n| **`deviceType`**    | \u003ccode\u003e\u003ca href=\"#devicetype\"\u003eDeviceType\u003c/a\u003e\u003c/code\u003e | The type of the camera lens.                                                 |\n| **`focalLength`**   | \u003ccode\u003enumber\u003c/code\u003e                               | The focal length of the lens in millimeters.                                 |\n| **`baseZoomRatio`** | \u003ccode\u003enumber\u003c/code\u003e                               | The base zoom factor for this lens (e.g., 0.5 for ultra-wide, 1.0 for wide). |\n| **`minZoom`**       | \u003ccode\u003enumber\u003c/code\u003e                               | The minimum zoom factor supported by this specific lens.                     |\n| **`maxZoom`**       | \u003ccode\u003enumber\u003c/code\u003e                               | The maximum zoom factor supported by this specific lens.                     |\n\n\n#### LensInfo\n\nRepresents the detailed information of the currently active lens.\n\n| Prop                | Type                                              | Description                                                      |\n| ------------------- | ------------------------------------------------- | ---------------------------------------------------------------- |\n| **`focalLength`**   | \u003ccode\u003enumber\u003c/code\u003e                               | The focal length of the active lens in millimeters.              |\n| **`deviceType`**    | \u003ccode\u003e\u003ca href=\"#devicetype\"\u003eDeviceType\u003c/a\u003e\u003c/code\u003e | The device type of the active lens.                              |\n| **`baseZoomRatio`** | \u003ccode\u003enumber\u003c/code\u003e                               | The base zoom ratio of the active lens (e.g., 0.5x, 1.0x).       |\n| **`digitalZoom`**   | \u003ccode\u003enumber\u003c/code\u003e                               | The current digital zoom factor applied on top of the base zoom. |\n\n\n#### PluginListenerHandle\n\n| Prop         | Type                                      |\n| ------------ | ----------------------------------------- |\n| **`remove`** | \u003ccode\u003e() =\u0026gt; Promise\u0026lt;void\u0026gt;\u003c/code\u003e |\n\n\n#### SafeAreaInsets\n\nRepresents safe area insets for devices.\nAndroid: Values are expressed in logical pixels (dp) to match JS layout units.\niOS: Values are expressed in physical pixels and exclude status bar.\n\n| Prop              | Type                | Description                                                                                                                                                                                                                                      |\n| ----------------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| **`orientation`** | \u003ccode\u003enumber\u003c/code\u003e | Current device orientation (1 = portrait, 2 = landscape, 0 = unknown).                                                                                                                                                                           |\n| **`top`**         | \u003ccode\u003enumber\u003c/code\u003e | Orientation-aware notch/camera cutout inset (excluding status bar). In portrait mode: returns top inset (notch at top). In landscape mode: returns left inset (notch at side). Android: Value in dp, iOS: Value in pixels (status bar excluded). |\n\n\n### Type Aliases\n\n\n#### GridMode\n\n\u003ccode\u003e'none' | '3x3' | '4x4'\u003c/code\u003e\n\n\n#### CameraPosition\n\n\u003ccode\u003e'rear' | 'front'\u003c/code\u003e\n\n\n#### CameraPositioning\n\n\u003ccode\u003e'center' | 'top' | 'bottom'\u003c/code\u003e\n\n\n#### PictureFormat\n\n\u003ccode\u003e'jpeg' | 'png'\u003c/code\u003e\n\n\n#### CameraPreviewFlashMode\n\nThe available flash modes for the camera.\n'torch' is a continuous light mode.\n\n\u003ccode\u003e'off' | 'on' | 'auto' | 'torch'\u003c/code\u003e\n\n\n#### PermissionState\n\n\u003ccode\u003e'prompt' | 'prompt-with-rationale' | 'granted' | 'denied'\u003c/code\u003e\n\n\n#### Pick\n\nFrom T, pick a set of properties whose keys are in the union K\n\n\u003ccode\u003e{\r [P in K]: T[P];\r }\u003c/code\u003e\n\n\n#### FlashMode\n\n\u003ccode\u003e\u003ca href=\"#camerapreviewflashmode\"\u003eCameraPreviewFlashMode\u003c/a\u003e\u003c/code\u003e\n\n\n#### DeviceOrientation\n\nCanonical device orientation values across platforms.\n\n\u003ccode\u003e'portrait' | 'landscape-left' | 'landscape-right' | 'portrait-upside-down' | 'unknown'\u003c/code\u003e\n\n\n#### ExposureMode\n\nReusable exposure mode type for cross-platform support.\n\n\u003ccode\u003e'AUTO' | 'LOCK' | 'CONTINUOUS' | 'CUSTOM'\u003c/code\u003e\n\n\n### Enums\n\n\n#### DeviceType\n\n| Members          | Value                    |\n| ---------------- | ------------------------ |\n| **`ULTRA_WIDE`** | \u003ccode\u003e'ultraWide'\u003c/code\u003e |\n| **`WIDE_ANGLE`** | \u003ccode\u003e'wideAngle'\u003c/code\u003e |\n| **`TELEPHOTO`**  | \u003ccode\u003e'telephoto'\u003c/code\u003e |\n| **`TRUE_DEPTH`** | \u003ccode\u003e'trueDepth'\u003c/code\u003e |\n| **`DUAL`**       | \u003ccode\u003e'dual'\u003c/code\u003e      |\n| **`DUAL_WIDE`**  | \u003ccode\u003e'dualWide'\u003c/code\u003e  |\n| **`TRIPLE`**     | \u003ccode\u003e'triple'\u003c/code\u003e    |\n\n\u003c/docgen-api\u003e\n\n## Compatibility\n\n| Plugin version | Capacitor compatibility | Maintained |\n| -------------- | ----------------------- | ---------- |\n| v8.\\*.\\*       | v8.\\*.\\*                | ✅          |\n| v7.\\*.\\*       | v7.\\*.\\*                | On demand   |\n| v6.\\*.\\*       | v6.\\*.\\*                | ❌          |\n| v5.\\*.\\*       | v5.\\*.\\*                | ❌          |\n\n\u003e **Note:** The major version of this plugin follows the major version of Capacitor. Use the version that matches your Capacitor installation (e.g., plugin v8 for Capacitor 8). Only the latest major version is actively maintained.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcap-go%2Fcapacitor-camera-preview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcap-go%2Fcapacitor-camera-preview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcap-go%2Fcapacitor-camera-preview/lists"}