capacitor-camera-view 2.4.0 → 3.0.0

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 (44) hide show
  1. package/CapacitorCameraView.podspec +1 -1
  2. package/Package.swift +1 -1
  3. package/README.md +341 -49
  4. package/android/build.gradle +0 -1
  5. package/android/src/main/AndroidManifest.xml +0 -1
  6. package/android/src/main/java/com/michaelwolz/capacitorcameraview/CameraError.kt +42 -0
  7. package/android/src/main/java/com/michaelwolz/capacitorcameraview/CameraView.kt +945 -207
  8. package/android/src/main/java/com/michaelwolz/capacitorcameraview/CameraViewPlugin.kt +87 -43
  9. package/android/src/main/java/com/michaelwolz/capacitorcameraview/model/BarcodeDetectionResult.kt +28 -2
  10. package/android/src/main/java/com/michaelwolz/capacitorcameraview/model/CameraDevice.kt +6 -1
  11. package/android/src/main/java/com/michaelwolz/capacitorcameraview/model/CameraSessionConfiguration.kt +15 -1
  12. package/android/src/main/java/com/michaelwolz/capacitorcameraview/model/TorchModeState.kt +15 -0
  13. package/android/src/main/java/com/michaelwolz/capacitorcameraview/model/WebBoundingRect.kt +1 -1
  14. package/android/src/main/java/com/michaelwolz/capacitorcameraview/utils.kt +73 -19
  15. package/dist/docs.json +475 -30
  16. package/dist/esm/definitions.d.ts +478 -26
  17. package/dist/esm/definitions.js.map +1 -1
  18. package/dist/esm/utils.d.ts +59 -15
  19. package/dist/esm/utils.js +79 -38
  20. package/dist/esm/utils.js.map +1 -1
  21. package/dist/esm/web.d.ts +191 -13
  22. package/dist/esm/web.js +624 -141
  23. package/dist/esm/web.js.map +1 -1
  24. package/dist/plugin.cjs.js +711 -179
  25. package/dist/plugin.cjs.js.map +1 -1
  26. package/dist/plugin.js +711 -179
  27. package/dist/plugin.js.map +1 -1
  28. package/ios/Sources/CameraViewPlugin/CameraError.swift +147 -2
  29. package/ios/Sources/CameraViewPlugin/CameraEvents.swift +41 -19
  30. package/ios/Sources/CameraViewPlugin/CameraSessionConfiguration.swift +29 -1
  31. package/ios/Sources/CameraViewPlugin/CameraViewManager+BarcodeScan.swift +78 -23
  32. package/ios/Sources/CameraViewPlugin/CameraViewManager+DeferredStart.swift +37 -0
  33. package/ios/Sources/CameraViewPlugin/CameraViewManager+Focus.swift +131 -0
  34. package/ios/Sources/CameraViewPlugin/CameraViewManager+Lifecycle.swift +156 -0
  35. package/ios/Sources/CameraViewPlugin/CameraViewManager+PhotoCapture.swift +73 -41
  36. package/ios/Sources/CameraViewPlugin/CameraViewManager+ResolutionSelection.swift +57 -0
  37. package/ios/Sources/CameraViewPlugin/CameraViewManager+Rotation.swift +195 -0
  38. package/ios/Sources/CameraViewPlugin/CameraViewManager+VideoDataOutput.swift +24 -12
  39. package/ios/Sources/CameraViewPlugin/CameraViewManager+VideoRecording.swift +22 -73
  40. package/ios/Sources/CameraViewPlugin/CameraViewManager+Zoom.swift +113 -0
  41. package/ios/Sources/CameraViewPlugin/CameraViewManager.swift +450 -403
  42. package/ios/Sources/CameraViewPlugin/CameraViewPlugin.swift +98 -65
  43. package/ios/Sources/CameraViewPlugin/Utils.swift +61 -7
  44. package/package.json +25 -9
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.js","sources":["esm/index.js","esm/utils.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\n/**\n * The main Capacitor Camera View plugin instance.\n */\nconst CameraView = registerPlugin('CameraView', {\n web: () => import('./web').then((m) => new m.CameraViewWeb()),\n});\nexport * from './definitions';\nexport { CameraView };\n//# sourceMappingURL=index.js.map","/**\n * Converts canvas to base64 string\n */\nexport function canvasToBase64(canvas, quality) {\n const dataUrl = canvas.toDataURL('image/jpeg', quality);\n return dataUrl.split(',')[1];\n}\n/**\n * Calculates the visible area of the video based on object-fit: cover\n */\nexport function calculateVisibleArea(video) {\n // Get the displayed dimensions of the video element\n const videoRect = video.getBoundingClientRect();\n const displayWidth = videoRect.width;\n const displayHeight = videoRect.height;\n // Get the intrinsic dimensions of the video\n const videoWidth = video.videoWidth;\n const videoHeight = video.videoHeight;\n // Calculate which portion of the video is visible (for object-fit: cover)\n const videoAspect = videoWidth / videoHeight;\n const displayAspect = displayWidth / displayHeight;\n let sourceX = 0;\n let sourceY = 0;\n let sourceWidth = videoWidth;\n let sourceHeight = videoHeight;\n // If video aspect ratio is greater than display aspect ratio,\n // the video is cropped on the sides\n if (videoAspect > displayAspect) {\n sourceWidth = videoHeight * displayAspect;\n sourceX = (videoWidth - sourceWidth) / 2;\n }\n // Otherwise the video is cropped on the top and bottom\n else {\n sourceHeight = videoWidth / displayAspect;\n sourceY = (videoHeight - sourceHeight) / 2;\n }\n return {\n sourceX,\n sourceY,\n sourceWidth,\n sourceHeight,\n displayWidth,\n displayHeight,\n };\n}\n/**\n * Draws the visible area of the video to the canvas\n */\nexport function drawVisibleAreaToCanvas(canvas, videoElement, area) {\n const { sourceX, sourceY, sourceWidth, sourceHeight, displayWidth, displayHeight } = area;\n // Set canvas size to match the displayed dimensions\n canvas.width = displayWidth;\n canvas.height = displayHeight;\n const ctx = canvas.getContext('2d', { alpha: false });\n if (!ctx) {\n throw new Error('Could not get canvas context');\n }\n // Draw only the visible portion of the video to match what the user sees\n ctx.drawImage(videoElement, sourceX, sourceY, sourceWidth, sourceHeight, 0, 0, displayWidth, displayHeight);\n}\n/**\n * Transforms barcode coordinates from the video source space to display space\n * accounting for object-fit: cover scaling and cropping.\n *\n * @param barcodeBoundingBox The original barcode bounding box from the detector\n * @param videoElement The video element with the camera stream\n * @returns The transformed bounding box coordinates in display space\n */\nexport function transformBarcodeBoundingBox(barcodeBoundingBox, videoElement) {\n // Get the video element's displayed dimensions\n const videoRect = videoElement.getBoundingClientRect();\n const displayWidth = videoRect.width;\n const displayHeight = videoRect.height;\n // Get original video dimensions\n const videoWidth = videoElement.videoWidth;\n const videoHeight = videoElement.videoHeight;\n // Calculate scaling and positioning for object-fit: cover\n const videoAspect = videoWidth / videoHeight;\n const displayAspect = displayWidth / displayHeight;\n let scaledX, scaledY, scaledWidth, scaledHeight;\n if (videoAspect > displayAspect) {\n // Video is wider than display area - height matches, width is centered and cropped\n const scale = displayHeight / videoHeight;\n const scaledVideoWidth = videoWidth * scale;\n const cropX = (scaledVideoWidth - displayWidth) / 2;\n scaledWidth = barcodeBoundingBox.width * scale;\n scaledHeight = barcodeBoundingBox.height * scale;\n scaledX = barcodeBoundingBox.x * scale - cropX;\n scaledY = barcodeBoundingBox.y * scale;\n }\n else {\n // Video is taller than display area - width matches, height is centered and cropped\n const scale = displayWidth / videoWidth;\n const scaledVideoHeight = videoHeight * scale;\n const cropY = (scaledVideoHeight - displayHeight) / 2;\n scaledWidth = barcodeBoundingBox.width * scale;\n scaledHeight = barcodeBoundingBox.height * scale;\n scaledX = barcodeBoundingBox.x * scale;\n scaledY = barcodeBoundingBox.y * scale - cropY;\n }\n return {\n x: scaledX,\n y: scaledY,\n width: scaledWidth,\n height: scaledHeight,\n };\n}\n//# sourceMappingURL=utils.js.map","var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n};\nvar __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n};\nvar _CameraViewWeb_isRunning;\nimport { WebPlugin } from '@capacitor/core';\nimport { calculateVisibleArea, canvasToBase64, drawVisibleAreaToCanvas, transformBarcodeBoundingBox } from './utils';\nexport const BARCODE_TYPE_TO_WEB_FORMAT = {\n qr: 'qr_code',\n code128: 'code_128',\n code39: 'code_39',\n code39Mod43: null,\n code93: 'code_93',\n ean8: 'ean_8',\n ean13: 'ean_13',\n interleaved2of5: 'itf',\n itf14: 'itf',\n pdf417: 'pdf417',\n aztec: 'aztec',\n dataMatrix: 'data_matrix',\n upce: 'upc_e',\n};\n/**\n * Web implementation of the CameraViewPlugin.\n * Optimized for performance and battery efficiency.\n */\nexport class CameraViewWeb extends WebPlugin {\n constructor() {\n super();\n // DOM elements\n this.videoElement = null;\n this.canvasElement = null;\n // Stream state\n this.stream = null;\n _CameraViewWeb_isRunning.set(this, false);\n // Configuration state\n this.currentCamera = 'environment'; // Default to back camera\n this.currentZoom = 1.0;\n this.currentFlashMode = 'off';\n // Barcode detection support\n this.barcodeDetectionSupported = false;\n this.barcodeDetector = null;\n // Recording state\n this.mediaRecorder = null;\n this.recordedChunks = [];\n this.recordingAudioTrack = null;\n this.recordingResolve = null;\n this.recordingReject = null;\n this.checkBarcodeDetectionSupport();\n }\n /**\n * Start the camera with the given configuration\n */\n async start(options) {\n if (__classPrivateFieldGet(this, _CameraViewWeb_isRunning, \"f\")) {\n return;\n }\n const permissionStatus = await this.requestPermissions();\n if (permissionStatus.camera !== 'granted') {\n throw new Error('Camera permission was not granted');\n }\n try {\n // Set up video element if it doesn't exist\n if (!this.videoElement) {\n await this.setupVideoElement(options === null || options === void 0 ? void 0 : options.containerElementId);\n }\n // Set up video constraints based on options\n const videoConstraints = {};\n // Prefer deviceId if specified\n if (options === null || options === void 0 ? void 0 : options.deviceId) {\n videoConstraints.deviceId = { exact: options.deviceId };\n // Remember the current camera mode (though we're using a specific device)\n this.currentCamera = (options === null || options === void 0 ? void 0 : options.position) === 'front' ? 'user' : 'environment';\n }\n else {\n // Fall back to facing mode\n const facingMode = (options === null || options === void 0 ? void 0 : options.position) === 'front' ? 'user' : 'environment';\n this.currentCamera = facingMode;\n videoConstraints.facingMode = facingMode;\n }\n const constraints = {\n video: videoConstraints,\n audio: false,\n };\n this.stream = await navigator.mediaDevices.getUserMedia(constraints);\n if (this.videoElement) {\n this.videoElement.srcObject = this.stream;\n this.videoElement.play();\n __classPrivateFieldSet(this, _CameraViewWeb_isRunning, true, \"f\");\n // If barcode detection is enabled and supported, start detection\n if (options === null || options === void 0 ? void 0 : options.enableBarcodeDetection) {\n await this.checkBarcodeDetectionSupport();\n if (this.barcodeDetectionSupported) {\n await this.configureBarcodeDetector(options === null || options === void 0 ? void 0 : options.barcodeTypes);\n this.startBarcodeDetection();\n }\n }\n }\n }\n catch (err) {\n throw new Error(`Failed to start camera: ${this.formatError(err)}`);\n }\n }\n /**\n * Stop the camera and release resources\n */\n async stop() {\n var _a;\n if (!__classPrivateFieldGet(this, _CameraViewWeb_isRunning, \"f\")) {\n return;\n }\n try {\n // Stop any active recording\n if (this.mediaRecorder && this.mediaRecorder.state !== 'inactive') {\n // Reject any pending stopRecording promise since we're force-stopping\n (_a = this.recordingReject) === null || _a === void 0 ? void 0 : _a.call(this, new Error('Camera session stopped while recording'));\n this.recordingResolve = null;\n this.recordingReject = null;\n this.mediaRecorder.stop();\n this.mediaRecorder = null;\n }\n this.recordedChunks = [];\n if (this.recordingAudioTrack) {\n this.recordingAudioTrack.stop();\n this.recordingAudioTrack = null;\n }\n // Stop all tracks in the stream\n if (this.stream) {\n this.stream.getTracks().forEach((track) => track.stop());\n this.stream = null;\n }\n // Clear video source\n if (this.videoElement) {\n this.videoElement = null;\n }\n __classPrivateFieldSet(this, _CameraViewWeb_isRunning, false, \"f\");\n }\n catch (err) {\n throw new Error(`Failed to stop camera: ${this.formatError(err)}`);\n }\n }\n /**\n * Check if the camera is currently running\n */\n async isRunning() {\n return { isRunning: __classPrivateFieldGet(this, _CameraViewWeb_isRunning, \"f\") };\n }\n /**\n * Capture a photo using the camera and return it as a base64-encoded JPEG image.\n * Preserves what the user actually sees in the UI, including cropping from object-fit: cover.\n */\n async capture(options) {\n const videoElement = this.videoElement;\n if (!__classPrivateFieldGet(this, _CameraViewWeb_isRunning, \"f\") || !videoElement) {\n throw new Error('Camera is not running');\n }\n try {\n const canvas = this.getCanvasElement();\n const visibleArea = calculateVisibleArea(videoElement);\n drawVisibleAreaToCanvas(canvas, videoElement, visibleArea);\n const quality = Math.min(1.0, Math.max(0.1, options.quality / 100));\n if (options.saveToFile) {\n // Create a blob from canvas and return a blob URL.\n // `path` is native-only (no filesystem path on web), so it is omitted here.\n return new Promise((resolve, reject) => {\n canvas.toBlob((blob) => {\n if (!blob) {\n reject(new Error('Failed to create blob from canvas'));\n return;\n }\n const url = URL.createObjectURL(blob);\n resolve({ webPath: url });\n }, 'image/jpeg', quality);\n });\n }\n else {\n // Return base64 data\n const base64Data = canvasToBase64(canvas, quality);\n return { photo: base64Data };\n }\n }\n catch (err) {\n throw new Error(`Failed to capture photo: ${this.formatError(err)}`);\n }\n }\n /**\n * Web implementation already uses images from the video stream, so this is the same as `capture()`\n */\n async captureSample(options) {\n return this.capture(options);\n }\n /**\n * Start recording video using MediaRecorder API\n */\n async startRecording(options) {\n if (!__classPrivateFieldGet(this, _CameraViewWeb_isRunning, \"f\") || !this.videoElement) {\n throw new Error('Camera is not running');\n }\n if (this.mediaRecorder) {\n throw new Error('Recording is already in progress');\n }\n try {\n let stream = this.stream;\n // If audio is requested, get a new stream with audio track\n if ((options === null || options === void 0 ? void 0 : options.enableAudio) && stream) {\n const audioStream = await navigator.mediaDevices.getUserMedia({ audio: true });\n const audioTrack = audioStream.getAudioTracks()[0];\n this.recordingAudioTrack = audioTrack;\n const videoTracks = stream.getVideoTracks();\n stream = new MediaStream([...videoTracks, audioTrack]);\n }\n if (!stream) {\n throw new Error('No camera stream available');\n }\n this.recordedChunks = [];\n const mimeType = ['video/webm;codecs=vp9', 'video/webm', 'video/mp4'].find((type) => MediaRecorder.isTypeSupported(type));\n if (!mimeType) {\n throw new Error('No supported video recording format found');\n }\n this.mediaRecorder = new MediaRecorder(stream, { mimeType });\n this.mediaRecorder.ondataavailable = (event) => {\n if (event.data && event.data.size > 0) {\n this.recordedChunks.push(event.data);\n }\n };\n this.mediaRecorder.onstop = () => {\n var _a;\n // Stop audio track if it was added for recording\n if (this.recordingAudioTrack) {\n this.recordingAudioTrack.stop();\n this.recordingAudioTrack = null;\n }\n const blob = new Blob(this.recordedChunks, { type: mimeType });\n const url = URL.createObjectURL(blob);\n this.recordedChunks = [];\n this.mediaRecorder = null;\n (_a = this.recordingResolve) === null || _a === void 0 ? void 0 : _a.call(this, { webPath: url });\n this.recordingResolve = null;\n this.recordingReject = null;\n };\n this.mediaRecorder.onerror = (event) => {\n var _a, _b, _c;\n if (this.recordingAudioTrack) {\n this.recordingAudioTrack.stop();\n this.recordingAudioTrack = null;\n }\n this.mediaRecorder = null;\n this.recordedChunks = [];\n const errorMessage = (_b = (_a = event.error) === null || _a === void 0 ? void 0 : _a.message) !== null && _b !== void 0 ? _b : 'Unknown recording error';\n (_c = this.recordingReject) === null || _c === void 0 ? void 0 : _c.call(this, new Error('Recording error: ' + errorMessage));\n this.recordingResolve = null;\n this.recordingReject = null;\n };\n this.mediaRecorder.start(100); // Collect data in 100ms chunks\n }\n catch (err) {\n if (this.recordingAudioTrack) {\n this.recordingAudioTrack.stop();\n this.recordingAudioTrack = null;\n }\n this.mediaRecorder = null;\n this.recordedChunks = [];\n throw new Error(`Failed to start recording: ${this.formatError(err)}`);\n }\n }\n /**\n * Stop the current video recording\n */\n async stopRecording() {\n if (!this.mediaRecorder) {\n throw new Error('No recording is in progress');\n }\n return new Promise((resolve, reject) => {\n var _a;\n this.recordingResolve = resolve;\n this.recordingReject = reject;\n (_a = this.mediaRecorder) === null || _a === void 0 ? void 0 : _a.stop();\n });\n }\n /**\n * Flip between front and back camera\n */\n async flipCamera() {\n if (!__classPrivateFieldGet(this, _CameraViewWeb_isRunning, \"f\")) {\n throw new Error('Camera is not running');\n }\n try {\n // Switch current camera\n this.currentCamera = this.currentCamera === 'user' ? 'environment' : 'user';\n // Stop current stream\n if (this.stream) {\n this.stream.getTracks().forEach((track) => track.stop());\n }\n // Restart with new facing mode\n const constraints = {\n video: {\n facingMode: this.currentCamera,\n },\n audio: false,\n };\n this.stream = await navigator.mediaDevices.getUserMedia(constraints);\n if (this.videoElement) {\n this.videoElement.srcObject = this.stream;\n }\n }\n catch (err) {\n throw new Error(`Failed to flip camera: ${this.formatError(err)}`);\n }\n }\n /**\n * Get available camera devices\n */\n async getAvailableDevices() {\n try {\n const devices = await navigator.mediaDevices.enumerateDevices();\n const videoDevices = devices.filter((device) => device.kind === 'videoinput');\n return {\n devices: videoDevices.map((device) => ({\n id: device.deviceId,\n name: device.label || `Camera ${device.deviceId.substring(0, 5)}`,\n position: device.label.toLowerCase().includes('front') ? 'front' : 'back',\n })),\n };\n }\n catch (err) {\n console.error('Failed to get available devices', err);\n return { devices: [] };\n }\n }\n /**\n * Get current zoom information (web has limited zoom support)\n */\n async getZoom() {\n // Web has limited zoom capabilities in most browsers,\n // we fake zoomin by scaling the video element\n return {\n min: 1.0,\n max: 3.0,\n current: this.currentZoom,\n };\n }\n /**\n * Set zoom level (limited support in web)\n */\n async setZoom(options) {\n // Store the requested zoom level\n this.currentZoom = options.level;\n // Apply visual zoom using CSS transform when native zoom isn't supported\n if (this.videoElement) {\n this.videoElement.style.transition = options.ramp ? 'transform 0.2s ease-in-out' : 'none';\n const scale = Math.max(1.0, Math.min(options.level, 3.0)); // Limit scale to reasonable bounds\n this.videoElement.style.transform = `scale(${scale})`;\n this.videoElement.style.transformOrigin = 'center';\n }\n }\n /**\n * Get current flash mode\n */\n async getFlashMode() {\n return { flashMode: this.currentFlashMode };\n }\n /**\n * Get supported flash modes\n */\n async getSupportedFlashModes() {\n // Web has limited flash control\n return { flashModes: ['off'] };\n }\n /**\n * Set flash mode (limited support in web)\n */\n async setFlashMode(options) {\n this.currentFlashMode = options.mode;\n console.warn('Flash mode control is not fully supported in the web implementation');\n }\n /**\n * Check if torch is available (not supported in web)\n */\n async isTorchAvailable() {\n // Torch is not supported in web implementation\n return { available: false };\n }\n /**\n * Get torch mode (not supported in web)\n */\n async getTorchMode() {\n // Torch is not supported in web implementation\n return { enabled: false, level: 0.0 };\n }\n /**\n * Set torch mode (not supported in web)\n */\n async setTorchMode() {\n // Torch is not supported in web implementation\n throw this.unimplemented('Torch control is not supported in web implementation.');\n }\n /**\n * Check camera and microphone permission without requesting\n */\n async checkPermissions() {\n try {\n // Use Permissions API if available\n if (navigator.permissions) {\n const [cameraResult, microphoneResult] = await Promise.all([\n navigator.permissions.query({ name: 'camera' }),\n navigator.permissions.query({ name: 'microphone' }),\n ]);\n return {\n camera: cameraResult.state === 'granted' ? 'granted' : cameraResult.state === 'denied' ? 'denied' : 'prompt',\n microphone: microphoneResult.state === 'granted'\n ? 'granted'\n : microphoneResult.state === 'denied'\n ? 'denied'\n : 'prompt',\n };\n }\n // If Permissions API is not available, fall back to checking the active stream\n return {\n camera: this.stream ? 'granted' : 'prompt',\n microphone: 'prompt',\n };\n }\n catch (err) {\n // If permissions API is not supported or fails\n return {\n camera: 'prompt',\n microphone: 'prompt',\n };\n }\n }\n /**\n * Request camera and/or microphone permissions from the user.\n * By default, only camera permission is requested.\n */\n async requestPermissions(options) {\n var _a;\n const permissions = (_a = options === null || options === void 0 ? void 0 : options.permissions) !== null && _a !== void 0 ? _a : ['camera'];\n const result = { camera: 'prompt', microphone: 'prompt' };\n // Request camera permission if included\n if (permissions.includes('camera')) {\n try {\n const stream = await navigator.mediaDevices.getUserMedia({ video: true });\n stream.getTracks().forEach((track) => track.stop());\n result.camera = 'granted';\n }\n catch (_b) {\n result.camera = 'denied';\n }\n }\n else {\n // Still report current status even if not requesting\n result.camera = (await this.checkPermissions()).camera;\n }\n // Request microphone permission only if explicitly included\n if (permissions.includes('microphone')) {\n try {\n const stream = await navigator.mediaDevices.getUserMedia({ audio: true });\n stream.getTracks().forEach((track) => track.stop());\n result.microphone = 'granted';\n }\n catch (_c) {\n result.microphone = 'denied';\n }\n }\n else {\n result.microphone = (await this.checkPermissions()).microphone;\n }\n return result;\n }\n /**\n * Start barcode detection if supported\n */\n async startBarcodeDetection() {\n const barcodeDetector = this.barcodeDetector;\n const videoElement = this.videoElement;\n if (!this.barcodeDetectionSupported || !barcodeDetector || !videoElement) {\n return;\n }\n // Make sure video is fully loaded before starting detection\n if (videoElement.readyState < 2) {\n await new Promise((resolve) => {\n const loadHandler = () => {\n videoElement.removeEventListener('loadeddata', loadHandler);\n resolve();\n };\n videoElement.addEventListener('loadeddata', loadHandler);\n });\n }\n // Add throttling to reduce CPU usage\n let lastDetectionTime = 0;\n const minTimeBetweenDetections = 100; // ms\n // Set up periodic frame analysis for barcode detection\n const detectFrame = async () => {\n if (!__classPrivateFieldGet(this, _CameraViewWeb_isRunning, \"f\") || !videoElement || !barcodeDetector) {\n return;\n }\n const now = Date.now();\n if (now - lastDetectionTime >= minTimeBetweenDetections) {\n try {\n const barcodes = await barcodeDetector.detect(videoElement);\n lastDetectionTime = now;\n if (barcodes.length > 0) {\n const barcode = barcodes[0];\n // Transform barcode coordinates using the utility function\n const boundingRect = transformBarcodeBoundingBox(barcode.boundingBox, videoElement);\n this.notifyListeners('barcodeDetected', {\n value: barcode.rawValue,\n type: barcode.format.toLowerCase(),\n boundingRect,\n });\n }\n }\n catch (err) {\n console.error('Barcode detection error', err);\n }\n }\n if (__classPrivateFieldGet(this, _CameraViewWeb_isRunning, \"f\")) {\n requestAnimationFrame(detectFrame);\n }\n };\n requestAnimationFrame(detectFrame);\n }\n /**\n * Clean up resources when the plugin is disposed\n */\n async handleOnDestroy() {\n var _a;\n await this.stop();\n // Remove elements from DOM\n if ((_a = this.videoElement) === null || _a === void 0 ? void 0 : _a.parentNode) {\n this.videoElement.parentNode.removeChild(this.videoElement);\n this.videoElement = null;\n }\n if (this.canvasElement) {\n this.canvasElement = null;\n }\n this.barcodeDetector = null;\n }\n /**\n * Check if barcode detection is supported in this browser\n */\n async checkBarcodeDetectionSupport() {\n if ('BarcodeDetector' in window) {\n try {\n this.barcodeDetector = new BarcodeDetector();\n this.barcodeDetectionSupported = true;\n }\n catch (e) {\n console.warn('BarcodeDetector is not supported by this browser.');\n this.barcodeDetectionSupported = false;\n }\n }\n }\n /**\n * Configure the barcode detector with requested barcode formats.\n * Unsupported formats are ignored and logged.\n */\n async configureBarcodeDetector(barcodeTypes) {\n if (!this.barcodeDetectionSupported) {\n return;\n }\n if (!(barcodeTypes === null || barcodeTypes === void 0 ? void 0 : barcodeTypes.length)) {\n this.barcodeDetector = new BarcodeDetector();\n return;\n }\n const requestedFormats = barcodeTypes\n .map((barcodeType) => {\n const webFormat = BARCODE_TYPE_TO_WEB_FORMAT[barcodeType];\n if (!webFormat) {\n console.warn(`[CameraView] Barcode type \"${barcodeType}\" is not supported by the web BarcodeDetector API.`);\n }\n return webFormat;\n })\n .filter((format) => format !== null);\n if (!requestedFormats.length) {\n console.warn('[CameraView] No requested barcode types are supported on web. Falling back to all supported formats.');\n this.barcodeDetector = new BarcodeDetector();\n return;\n }\n const uniqueRequestedFormats = Array.from(new Set(requestedFormats));\n try {\n const supportedFormats = await BarcodeDetector.getSupportedFormats();\n const configuredFormats = uniqueRequestedFormats.filter((format) => supportedFormats.includes(format));\n const ignoredFormats = uniqueRequestedFormats.filter((format) => !supportedFormats.includes(format));\n if (ignoredFormats.length) {\n console.warn(`[CameraView] Ignoring unsupported barcode formats for this browser: ${ignoredFormats.join(', ')}.`);\n }\n if (!configuredFormats.length) {\n console.warn('[CameraView] No requested barcode formats are available in this browser. Falling back to all supported formats.');\n this.barcodeDetector = new BarcodeDetector();\n return;\n }\n this.barcodeDetector = new BarcodeDetector({ formats: configuredFormats });\n }\n catch (error) {\n console.warn('[CameraView] Failed to resolve supported barcode formats; falling back to unfiltered detector.', error);\n this.barcodeDetector = new BarcodeDetector();\n }\n }\n /**\n * Set up the video element for the camera view\n */\n async setupVideoElement(containerElementId) {\n this.videoElement = document.createElement('video');\n this.videoElement.playsInline = true;\n this.videoElement.autoplay = true;\n this.videoElement.muted = true;\n this.videoElement.style.width = '100%';\n this.videoElement.style.height = '100%';\n this.videoElement.style.objectFit = 'cover';\n // If a container ID is provided, find that element and append the video to it\n if (containerElementId) {\n const container = document.getElementById(containerElementId);\n if (!container) {\n throw new Error(`Container element with ID ${containerElementId} not found`);\n }\n container.appendChild(this.videoElement);\n }\n else {\n // Otherwise, append to body as fallback\n document.body.appendChild(this.videoElement);\n }\n }\n /**\n * Ensures canvas element exists and returns it\n */\n getCanvasElement() {\n if (!this.canvasElement) {\n this.canvasElement = document.createElement('canvas');\n }\n return this.canvasElement;\n }\n /**\n * Format error message\n */\n formatError(err) {\n return err instanceof Error ? err.message : String(err);\n }\n}\n_CameraViewWeb_isRunning = new WeakMap();\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","this","WebPlugin"],"mappings":";;;IACA;IACA;IACA;AACK,UAAC,UAAU,GAAGA,mBAAc,CAAC,YAAY,EAAE;IAChD,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,aAAa,EAAE,CAAC;IACjE,CAAC;;ICND;IACA;IACA;IACO,SAAS,cAAc,CAAC,MAAM,EAAE,OAAO,EAAE;IAChD,IAAI,MAAM,OAAO,GAAG,MAAM,CAAC,SAAS,CAAC,YAAY,EAAE,OAAO,CAAC;IAC3D,IAAI,OAAO,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IAChC;IACA;IACA;IACA;IACO,SAAS,oBAAoB,CAAC,KAAK,EAAE;IAC5C;IACA,IAAI,MAAM,SAAS,GAAG,KAAK,CAAC,qBAAqB,EAAE;IACnD,IAAI,MAAM,YAAY,GAAG,SAAS,CAAC,KAAK;IACxC,IAAI,MAAM,aAAa,GAAG,SAAS,CAAC,MAAM;IAC1C;IACA,IAAI,MAAM,UAAU,GAAG,KAAK,CAAC,UAAU;IACvC,IAAI,MAAM,WAAW,GAAG,KAAK,CAAC,WAAW;IAC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BAAkB,CAAC;IACzE,YAAY,IAAI,CAAC,SAAS,EAAE;IAC5B,gBAAgB,MAAM,IAAI,KAAK,CAAC,CAAC,0BAA0B,EAAE,kBAAkB,CAAC,UAAU,CAAC,CAAC;IAC5F,YAAY;IACZ,YAAY,SAAS,CAAC,WAAW,CAAC,IAAI,CAAC,YAAY,CAAC;IACpD,QAAQ;IACR,aAAa;IACb;IACA,YAAY,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,YAAY,CAAC;IACxD,QAAQ;IACR,IAAI;IACJ;IACA;IACA;IACA,IAAI,gBAAgB,GAAG;IACvB,QAAQ,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE;IACjC,YAAY,IAAI,CAAC,aAAa,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC;IACjE,QAAQ;IACR,QAAQ,OAAO,IAAI,CAAC,aAAa;IACjC,IAAI;IACJ;IACA;IACA;IACA,IAAI,WAAW,CAAC,GAAG,EAAE;IACrB,QAAQ,OAAO,GAAG,YAAY,KAAK,GAAG,GAAG,CAAC,OAAO,GAAG,MAAM,CAAC,GAAG,CAAC;IAC/D,IAAI;IACJ;IACA,wBAAwB,GAAG,IAAI,OAAO,EAAE;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"plugin.js","sources":["esm/index.js","esm/utils.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\n/**\n * The main Capacitor Camera View plugin instance.\n */\nconst CameraView = registerPlugin('CameraView', {\n web: () => import('./web').then((m) => new m.CameraViewWeb()),\n});\nexport * from './definitions';\nexport { CameraView };\n//# sourceMappingURL=index.js.map","/**\n * Converts canvas to base64 string\n */\nexport function canvasToBase64(canvas, quality) {\n const dataUrl = canvas.toDataURL('image/jpeg', quality);\n return dataUrl.split(',')[1];\n}\n/**\n * Calculates the visible area of the video based on object-fit: cover.\n *\n * The `output*` dimensions default to the visible crop's intrinsic (source)\n * pixel size, so a capture keeps the full detail the stream delivers for that\n * region instead of being downscaled to CSS pixels.\n */\nexport function calculateVisibleArea(video) {\n // Get the displayed dimensions of the video element\n const videoRect = video.getBoundingClientRect();\n const displayWidth = videoRect.width;\n const displayHeight = videoRect.height;\n // Get the intrinsic dimensions of the video\n const videoWidth = video.videoWidth;\n const videoHeight = video.videoHeight;\n // Calculate which portion of the video is visible (for object-fit: cover)\n const videoAspect = videoWidth / videoHeight;\n const displayAspect = displayWidth / displayHeight;\n let sourceX = 0;\n let sourceY = 0;\n let sourceWidth = videoWidth;\n let sourceHeight = videoHeight;\n // If video aspect ratio is greater than display aspect ratio,\n // the video is cropped on the sides\n if (videoAspect > displayAspect) {\n sourceWidth = videoHeight * displayAspect;\n sourceX = (videoWidth - sourceWidth) / 2;\n }\n // Otherwise the video is cropped on the top and bottom\n else {\n sourceHeight = videoWidth / displayAspect;\n sourceY = (videoHeight - sourceHeight) / 2;\n }\n // Rasterize the capture at the visible crop's native resolution. Rounding\n // keeps the canvas dimensions integral without distorting the aspect ratio.\n const outputWidth = Math.round(sourceWidth);\n const outputHeight = Math.round(sourceHeight);\n return {\n sourceX,\n sourceY,\n sourceWidth,\n sourceHeight,\n displayWidth,\n displayHeight,\n outputWidth,\n outputHeight,\n };\n}\n/**\n * The full video frame as a {@link VisibleArea}: no cropping, rasterized at\n * the stream's intrinsic resolution.\n *\n * Used when the session was started with an explicit `aspectRatio`, where the\n * cross-platform contract is that `capture()` returns the full sensor-ratio\n * frame rather than the on-screen cover-cropped region.\n */\nexport function calculateFullFrameArea(video) {\n const videoRect = video.getBoundingClientRect();\n return {\n sourceX: 0,\n sourceY: 0,\n sourceWidth: video.videoWidth,\n sourceHeight: video.videoHeight,\n displayWidth: videoRect.width,\n displayHeight: videoRect.height,\n outputWidth: video.videoWidth,\n outputHeight: video.videoHeight,\n };\n}\n/**\n * Further crops a {@link VisibleArea} to account for a CSS `transform: scale()`\n * zoom applied to the video element.\n *\n * The CSS-fallback zoom magnifies the preview about its center, but\n * `getBoundingClientRect()` reports the post-transform size and therefore\n * leaves the crop unchanged. Tightening the source rectangle by `scale`, kept\n * centered, makes a capture match what the user actually sees.\n *\n * A `scale <= 1` (no zoom) returns the area unchanged.\n */\nexport function applyCssZoomCrop(area, scale) {\n if (!(scale > 1)) {\n return area;\n }\n const sourceWidth = area.sourceWidth / scale;\n const sourceHeight = area.sourceHeight / scale;\n return Object.assign(Object.assign({}, area), { sourceX: area.sourceX + (area.sourceWidth - sourceWidth) / 2, sourceY: area.sourceY + (area.sourceHeight - sourceHeight) / 2, sourceWidth,\n sourceHeight, outputWidth: Math.round(sourceWidth), outputHeight: Math.round(sourceHeight) });\n}\n/**\n * Draws the visible area of the video to the canvas at the crop's target\n * output resolution (see {@link VisibleArea.outputWidth}).\n */\nexport function drawVisibleAreaToCanvas(canvas, videoElement, area) {\n const { sourceX, sourceY, sourceWidth, sourceHeight, outputWidth, outputHeight } = area;\n // Sized to the crop's intrinsic pixel size rather than the CSS-pixel preview\n // size, so the JPEG keeps the stream's real detail.\n canvas.width = outputWidth;\n canvas.height = outputHeight;\n const ctx = canvas.getContext('2d', { alpha: false });\n if (!ctx) {\n throw new Error('Could not get canvas context');\n }\n // Draw only the visible portion of the video to match what the user sees\n ctx.drawImage(videoElement, sourceX, sourceY, sourceWidth, sourceHeight, 0, 0, outputWidth, outputHeight);\n}\n/**\n * Transforms barcode coordinates from the video source space to display space,\n * accounting for how the video element is scaled into its container.\n *\n * Both `object-fit` modes are a single-scale, centered mapping and share one\n * formula, differing only in which axis scale wins: `'cover'` takes the larger\n * (center-cropped), `'fit'` the smaller (letterboxed).\n *\n * @param barcodeBoundingBox The original barcode bounding box from the detector\n * @param videoElement The video element with the camera stream\n * @param scaleMode Whether the preview uses `cover` or `fit` scaling\n * @returns The transformed bounding box coordinates in display space\n */\nexport function transformBarcodeBoundingBox(barcodeBoundingBox, videoElement, scaleMode = 'cover') {\n // Get the video element's displayed dimensions\n const videoRect = videoElement.getBoundingClientRect();\n const displayWidth = videoRect.width;\n const displayHeight = videoRect.height;\n // Get original video dimensions\n const videoWidth = videoElement.videoWidth;\n const videoHeight = videoElement.videoHeight;\n const scaleX = displayWidth / videoWidth;\n const scaleY = displayHeight / videoHeight;\n const scale = scaleMode === 'fit' ? Math.min(scaleX, scaleY) : Math.max(scaleX, scaleY);\n // Centering offset of the scaled frame within the container: negative on a\n // cropped axis, positive on a letterboxed one.\n const offsetX = (displayWidth - videoWidth * scale) / 2;\n const offsetY = (displayHeight - videoHeight * scale) / 2;\n return {\n x: barcodeBoundingBox.x * scale + offsetX,\n y: barcodeBoundingBox.y * scale + offsetY,\n width: barcodeBoundingBox.width * scale,\n height: barcodeBoundingBox.height * scale,\n };\n}\n//# sourceMappingURL=utils.js.map","var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n};\nvar __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n};\nvar _CameraViewWeb_isRunning;\nimport { WebPlugin } from '@capacitor/core';\nimport { applyCssZoomCrop, calculateFullFrameArea, calculateVisibleArea, canvasToBase64, drawVisibleAreaToCanvas, transformBarcodeBoundingBox, } from './utils';\n/**\n * Suppression window in milliseconds during which a repeat of the same barcode\n * (identical value + type) is not re-emitted. A genuinely new code still emits\n * immediately. Kept consistent with the iOS and Android implementations.\n */\nexport const BARCODE_SUPPRESSION_WINDOW_MS = 500;\n/**\n * Once the per-key dedupe map grows past this size, expired entries are pruned\n * so a long session scanning many different codes stays bounded. Kept\n * consistent with the iOS and Android implementations.\n */\nexport const BARCODE_DEDUPE_MAP_PRUNE_THRESHOLD = 64;\n/**\n * Backstop for the \"wait until the video is ready\" step in\n * {@link CameraViewWeb.startBarcodeDetection}. If the video element never\n * fires `loadeddata` (e.g. a stalled stream), the wait settles anyway after\n * this many milliseconds instead of leaving a dangling listener and a\n * permanently pending promise.\n */\nexport const BARCODE_VIDEO_READY_TIMEOUT_MS = 5000;\n/**\n * Baseline `ideal` capture resolution requested from `getUserMedia` in\n * {@link CameraViewWeb.start}. Without any width/height hint, browsers default\n * to a low-resolution stream (often 640x480), which caps capture quality.\n *\n * These are `ideal` (not `exact`/`min`) so devices that cannot deliver\n * 1080p-class video still start at their best available resolution rather\n * than failing acquisition.\n */\nexport const DEFAULT_IDEAL_CAPTURE_WIDTH = 1920;\nexport const DEFAULT_IDEAL_CAPTURE_HEIGHT = 1080;\n/**\n * Bounds for the CSS `transform: scale()` zoom simulation used when the browser\n * does not expose a native `zoom` track capability. `getZoom` reports this\n * range and `setZoom` clamps the applied scale to it in fallback mode.\n */\nexport const SIMULATED_ZOOM_MIN = 1.0;\nexport const SIMULATED_ZOOM_MAX = 3.0;\nexport const BARCODE_TYPE_TO_WEB_FORMAT = {\n qr: 'qr_code',\n code128: 'code_128',\n code39: 'code_39',\n code39Mod43: null,\n code93: 'code_93',\n codabar: 'codabar',\n ean8: 'ean_8',\n ean13: 'ean_13',\n interleaved2of5: 'itf',\n itf14: 'itf',\n pdf417: 'pdf417',\n aztec: 'aztec',\n dataMatrix: 'data_matrix',\n upcA: 'upc_a',\n upce: 'upc_e',\n};\n/**\n * Inverse of {@link BARCODE_TYPE_TO_WEB_FORMAT}: maps the web BarcodeDetector\n * format back onto the cross-platform {@link BarcodeType} vocabulary so the\n * `barcodeDetected` event emits the same `type` values as iOS and Android.\n *\n * Note: `interleaved2of5` and `itf14` both map to the web format `itf`, so the\n * inversion has a collision that is resolved by insertion order — `itf14` comes\n * last in {@link BARCODE_TYPE_TO_WEB_FORMAT} and wins, which is the intended\n * result for `itf` detections.\n */\nexport const WEB_FORMAT_TO_BARCODE_TYPE = Object.entries(BARCODE_TYPE_TO_WEB_FORMAT).reduce((acc, [barcodeType, webFormat]) => {\n if (webFormat) {\n acc[webFormat] = barcodeType;\n }\n return acc;\n}, {});\n/**\n * Error thrown by the web implementation for a rejected plugin call.\n *\n * Carries a stable `code` from the {@link CameraErrorCode} vocabulary, the\n * same public contract iOS and Android provide, so consumers can `switch` on\n * `error.code` instead of matching on the human-readable `message`.\n *\n * Methods that reject via `WebPlugin.unimplemented()` are the one exception:\n * those keep Capacitor's own `UNIMPLEMENTED` convention.\n */\nexport class CameraViewError extends Error {\n constructor(message, code) {\n super(message);\n this.name = 'CameraViewError';\n this.code = code;\n }\n}\n/**\n * Classifies a `getUserMedia` failure into the closest-fitting\n * {@link CameraErrorCode}, shared by every acquisition site.\n *\n * `kind` selects which media type's dedicated codes apply for `NotFoundError`/\n * `NotReadableError` so a missing/busy camera and a missing/busy microphone\n * aren't conflated. Anything unmappable falls back to `UNKNOWN_ERROR`.\n */\nexport function classifyGetUserMediaErrorCode(err, kind) {\n if (err instanceof DOMException) {\n switch (err.name) {\n case 'NotAllowedError':\n return 'PERMISSION_DENIED';\n case 'NotFoundError':\n return kind === 'camera' ? 'CAMERA_UNAVAILABLE' : 'AUDIO_DEVICE_UNAVAILABLE';\n case 'NotReadableError':\n return kind === 'camera' ? 'DEVICE_LOCKED' : 'AUDIO_INPUT_ADDITION_FAILED';\n }\n }\n return 'UNKNOWN_ERROR';\n}\n/**\n * Web implementation of the CameraViewPlugin.\n * Optimized for performance and battery efficiency.\n */\nexport class CameraViewWeb extends WebPlugin {\n constructor() {\n super();\n // DOM elements\n this.videoElement = null;\n this.canvasElement = null;\n // Stream state\n this.stream = null;\n _CameraViewWeb_isRunning.set(this, false);\n // Configuration state\n this.currentCamera = 'environment'; // Default to back camera\n this.currentZoom = 1.0;\n // Whether the current zoom is applied through the native track `zoom`\n // capability (`applyConstraints`) rather than the CSS `transform: scale()`\n // simulation. Capture only needs to compensate for the transform in the\n // CSS-fallback case.\n this.usingNativeZoom = false;\n this.currentFlashMode = 'off';\n // The aspect ratio the current session was started with, or null when the\n // option was omitted. Selects the capture contract: with an explicit ratio,\n // capture() returns the full sensor-ratio frame (cross-platform contract);\n // without it, the legacy web behavior of capturing the visible\n // (cover-cropped) preview region is preserved.\n this.sessionAspectRatio = null;\n // How the current session scales the preview into its container. `'fit'`\n // (object-fit: contain) letterboxes the whole frame; `'cover'` (the default)\n // center-crops it. Selects the barcode-transform variant and, together with\n // the aspect ratio, the capture crop.\n this.sessionPreviewScaleMode = 'cover';\n // Resolution/aspect-ratio constraints of the current session, kept so\n // flipCamera() re-acquires the stream with the same resolution contract\n // instead of falling back to the browser default.\n this.sessionResolutionConstraints = {};\n // Barcode detection support\n this.barcodeDetectionSupported = false;\n this.barcodeDetector = null;\n // Scopes the barcode detection loop to a single start()/stop() session so a\n // rapid stop() -> start() can't let the old loop mistake the new session's\n // running flag for its own and keep polling a detached video element.\n this.barcodeDetectionAbortController = null;\n // The most recently scheduled `requestAnimationFrame` id for the barcode\n // detection loop, so `stop()` can cancel a queued-but-not-yet-run frame\n // outright.\n this.barcodeAnimationFrameId = null;\n // Recording state\n this.mediaRecorder = null;\n this.recordedChunks = [];\n this.recordingAudioTrack = null;\n this.recordingResolve = null;\n this.recordingReject = null;\n this.checkBarcodeDetectionSupport();\n }\n /**\n * Start the camera with the given configuration\n */\n async start(options) {\n var _a, _b, _c, _d;\n // A session is already running. Per the cross-platform contract, reject\n // instead of silently reconfiguring or no-op'ing: callers who need a\n // different configuration (e.g. a different position or resolution) must\n // call `stop()` first and then `start()` again with the new options.\n if (__classPrivateFieldGet(this, _CameraViewWeb_isRunning, \"f\")) {\n throw new CameraViewError('Camera session is already running. Call stop() first.', 'SESSION_ALREADY_RUNNING');\n }\n try {\n // Set up video element if it doesn't exist\n if (!this.videoElement) {\n await this.setupVideoElement(options === null || options === void 0 ? void 0 : options.containerElementId);\n }\n }\n catch (err) {\n // The only failure path in setupVideoElement() is the target container\n // element not being found, which is the web equivalent of \"could not\n // find the view to render the camera preview into\".\n throw new CameraViewError(`Failed to start camera: ${this.formatError(err)}`, 'WEBVIEW_UNAVAILABLE');\n }\n // Apply the preview scale mode to the video element. `'fit'` letterboxes\n // the whole frame (object-fit: contain); the empty bars show the container's\n // own background. `'cover'` keeps the long-standing center-cropped preview.\n this.sessionPreviewScaleMode = (_a = options === null || options === void 0 ? void 0 : options.previewScaleMode) !== null && _a !== void 0 ? _a : 'cover';\n if (this.videoElement) {\n this.videoElement.style.objectFit = this.sessionPreviewScaleMode === 'fit' ? 'contain' : 'cover';\n }\n // Set up video constraints based on options\n this.sessionAspectRatio = (_b = options === null || options === void 0 ? void 0 : options.aspectRatio) !== null && _b !== void 0 ? _b : null;\n this.sessionResolutionConstraints = this.buildResolutionConstraints(options);\n const videoConstraints = Object.assign({}, this.sessionResolutionConstraints);\n // Prefer deviceId if specified\n if (options === null || options === void 0 ? void 0 : options.deviceId) {\n videoConstraints.deviceId = { exact: options.deviceId };\n // Remember the current camera mode (though we're using a specific device)\n this.currentCamera = (options === null || options === void 0 ? void 0 : options.position) === 'front' ? 'user' : 'environment';\n }\n else {\n // Fall back to facing mode\n const facingMode = (options === null || options === void 0 ? void 0 : options.position) === 'front' ? 'user' : 'environment';\n this.currentCamera = facingMode;\n videoConstraints.facingMode = facingMode;\n }\n const constraints = {\n video: videoConstraints,\n audio: false,\n };\n // Acquire the camera exactly once, using the real constraints, and derive\n // the permission outcome from this single call. Probing permission with a\n // throwaway acquisition first would double startup latency, flash the\n // camera indicator twice, and risk a spurious NotReadableError on devices\n // where the camera is exclusive.\n try {\n this.stream = await navigator.mediaDevices.getUserMedia(constraints);\n }\n catch (err) {\n throw this.mapStartAcquisitionError(err);\n }\n try {\n if (this.videoElement) {\n this.videoElement.srcObject = this.stream;\n // Some browsers' autoplay policies can reject `play()` (e.g. lack of a\n // recent user gesture). The element is muted + playsInline, which satisfies\n // autoplay policies in virtually all cases, but a rejection must still be\n // handled here rather than left as an unhandled promise rejection.\n try {\n await this.videoElement.play();\n }\n catch (err) {\n console.warn('[CameraView] Failed to autoplay the video preview', err);\n }\n __classPrivateFieldSet(this, _CameraViewWeb_isRunning, true, \"f\");\n // Apply the initial zoom. This also re-establishes zoom on the freshly\n // created video element after a stop()/start() cycle, keeping the\n // applied zoom in sync with `currentZoom` instead of silently resetting\n // to an untransformed element. A zoom failure must not abort start().\n try {\n await this.setZoom({ level: (_c = options === null || options === void 0 ? void 0 : options.zoomFactor) !== null && _c !== void 0 ? _c : 1.0 });\n }\n catch (err) {\n console.warn('[CameraView] Failed to apply initial zoom factor', err);\n }\n // If barcode detection is enabled and supported, start detection\n if (options === null || options === void 0 ? void 0 : options.enableBarcodeDetection) {\n await this.checkBarcodeDetectionSupport();\n if (this.barcodeDetectionSupported) {\n await this.configureBarcodeDetector(options === null || options === void 0 ? void 0 : options.barcodeTypes);\n this.startBarcodeDetection();\n }\n }\n }\n }\n catch (err) {\n // The stream was already acquired here, so its tracks are still live.\n // Tear down the partially-initialized session state so the thrown error\n // leaves a clean slate for a subsequent start().\n (_d = this.stream) === null || _d === void 0 ? void 0 : _d.getTracks().forEach((track) => track.stop());\n this.stream = null;\n __classPrivateFieldSet(this, _CameraViewWeb_isRunning, false, \"f\");\n if (this.videoElement) {\n this.videoElement.srcObject = null;\n }\n throw new CameraViewError(`Failed to start camera: ${this.formatError(err)}`, 'UNKNOWN_ERROR');\n }\n }\n /**\n * Builds the resolution/aspect-ratio part of the `getUserMedia` video\n * constraints for a session.\n *\n * `captureMaxDimension` replaces the ideal width (the longer edge in the\n * stream's landscape-oriented coordinate space) and the ideal height is\n * derived from the configured ratio. Everything stays `ideal` so acquisition\n * degrades gracefully on devices that cannot deliver the request.\n */\n buildResolutionConstraints(options) {\n var _a;\n const ratio = (options === null || options === void 0 ? void 0 : options.aspectRatio) === '4:3' ? 4 / 3 : 16 / 9;\n const idealWidth = (_a = options === null || options === void 0 ? void 0 : options.captureMaxDimension) !== null && _a !== void 0 ? _a : DEFAULT_IDEAL_CAPTURE_WIDTH;\n const idealHeight = Math.round(idealWidth / ratio);\n const constraints = {\n width: { ideal: idealWidth },\n height: { ideal: idealHeight },\n };\n if (options === null || options === void 0 ? void 0 : options.aspectRatio) {\n constraints.aspectRatio = { ideal: ratio };\n }\n return constraints;\n }\n /**\n * Map a `getUserMedia` failure from the real-constraints acquisition in\n * `start()` onto the plugin's error contract.\n *\n * `NotAllowedError` maps to `PERMISSION_DENIED`, `NotFoundError` (no\n * matching device) to `CAMERA_UNAVAILABLE`, and `NotReadableError` (device\n * claimed by another process) to `DEVICE_LOCKED`, matching the codes\n * iOS/Android use. Anything else falls back to `UNKNOWN_ERROR`.\n */\n mapStartAcquisitionError(err) {\n if (err instanceof DOMException) {\n switch (err.name) {\n case 'NotAllowedError':\n return new CameraViewError('Camera permission was not granted', 'PERMISSION_DENIED');\n case 'NotFoundError':\n return new CameraViewError('Failed to start camera: No camera matching the requested configuration was found.', 'CAMERA_UNAVAILABLE');\n case 'NotReadableError':\n return new CameraViewError('Failed to start camera: The camera could not be started, possibly because it is already in use by another application.', 'DEVICE_LOCKED');\n }\n }\n return new CameraViewError(`Failed to start camera: ${this.formatError(err)}`, 'UNKNOWN_ERROR');\n }\n /**\n * Stop the camera and release resources\n */\n async stop() {\n var _a, _b, _c;\n if (!__classPrivateFieldGet(this, _CameraViewWeb_isRunning, \"f\")) {\n return;\n }\n try {\n // Tear down the barcode detection session tied to this camera session\n // first: abort settles any pending video-ready wait in\n // startBarcodeDetection, and cancelling the animation frame stops a\n // queued detectFrame call from ever running. Together these ensure no\n // stale loop can survive into a subsequent start().\n (_a = this.barcodeDetectionAbortController) === null || _a === void 0 ? void 0 : _a.abort();\n this.barcodeDetectionAbortController = null;\n if (this.barcodeAnimationFrameId !== null) {\n cancelAnimationFrame(this.barcodeAnimationFrameId);\n this.barcodeAnimationFrameId = null;\n }\n // Stop any active recording\n if (this.mediaRecorder && this.mediaRecorder.state !== 'inactive') {\n // Reject any pending stopRecording promise since we're force-stopping.\n // There is no dedicated code for this case, so it falls back to\n // UNKNOWN_ERROR per the plugin's documented \"anything unmappable\"\n // contract.\n (_b = this.recordingReject) === null || _b === void 0 ? void 0 : _b.call(this, new CameraViewError('Camera session stopped while recording', 'UNKNOWN_ERROR'));\n this.recordingResolve = null;\n this.recordingReject = null;\n this.mediaRecorder.stop();\n this.mediaRecorder = null;\n }\n this.recordedChunks = [];\n if (this.recordingAudioTrack) {\n this.recordingAudioTrack.stop();\n this.recordingAudioTrack = null;\n }\n // Stop all tracks in the stream\n if (this.stream) {\n this.stream.getTracks().forEach((track) => track.stop());\n this.stream = null;\n }\n // Detach the stream and remove the video element from the DOM\n if (this.videoElement) {\n this.videoElement.pause();\n this.videoElement.srcObject = null;\n (_c = this.videoElement.parentNode) === null || _c === void 0 ? void 0 : _c.removeChild(this.videoElement);\n this.videoElement = null;\n }\n __classPrivateFieldSet(this, _CameraViewWeb_isRunning, false, \"f\");\n }\n catch (err) {\n // No dedicated code for a teardown failure; falls back to UNKNOWN_ERROR\n // per the plugin's documented \"anything unmappable\" contract.\n throw new CameraViewError(`Failed to stop camera: ${this.formatError(err)}`, 'UNKNOWN_ERROR');\n }\n }\n /**\n * Check if the camera is currently running\n */\n async isRunning() {\n return { isRunning: __classPrivateFieldGet(this, _CameraViewWeb_isRunning, \"f\") };\n }\n /**\n * Capture a photo using the camera and return it as a base64-encoded JPEG image.\n * Preserves what the user actually sees in the UI, including cropping from object-fit: cover.\n */\n async capture(options) {\n var _a;\n const videoElement = this.videoElement;\n if (!__classPrivateFieldGet(this, _CameraViewWeb_isRunning, \"f\") || !videoElement) {\n throw new CameraViewError('Camera is not running', 'SESSION_NOT_RUNNING');\n }\n try {\n const canvas = this.getCanvasElement();\n // `fit` mode letterboxes the whole frame and an explicit `aspectRatio`\n // contractually returns the full sensor-ratio frame, so both capture\n // uncropped. Otherwise capture the visible (cover-cropped) region so the\n // output matches what the user sees.\n const captureArea = this.sessionPreviewScaleMode === 'fit' || this.sessionAspectRatio\n ? calculateFullFrameArea(videoElement)\n : calculateVisibleArea(videoElement);\n // In CSS-fallback zoom mode the preview is magnified about its center via\n // `transform: scale()`, so tighten the source crop to match the zoomed\n // viewport (this preserves the frame's aspect ratio). Native-zoom mode\n // needs no compensation: the track already delivers the zoomed frame.\n const visibleArea = applyCssZoomCrop(captureArea, this.getCssZoomScale());\n drawVisibleAreaToCanvas(canvas, videoElement, visibleArea);\n // Mirror the native platforms' default: `quality` is optional and defaults\n // to 90 when omitted. Without this, `options?.quality / 100` would be\n // `NaN` for an undefined quality, which is passed silently to `toBlob`/\n // `toDataURL` (both treat an invalid quality as \"use the default\"), so a\n // caller relying on the documented default would get a different result\n // on web than on iOS/Android.\n const requestedQuality = (_a = options === null || options === void 0 ? void 0 : options.quality) !== null && _a !== void 0 ? _a : 90;\n const quality = Math.min(1.0, Math.max(0.1, requestedQuality / 100));\n if (options === null || options === void 0 ? void 0 : options.saveToFile) {\n // Create a blob from canvas and return a blob URL.\n // `path` is native-only (no filesystem path on web), so it is omitted here.\n return new Promise((resolve, reject) => {\n canvas.toBlob((blob) => {\n if (!blob) {\n reject(new CameraViewError('Failed to create blob from canvas', 'IMAGE_COMPRESSION_FAILED'));\n return;\n }\n const url = URL.createObjectURL(blob);\n resolve({ webPath: url });\n }, 'image/jpeg', quality);\n });\n }\n else {\n // Return base64 data\n const base64Data = canvasToBase64(canvas, quality);\n return { photo: base64Data };\n }\n }\n catch (err) {\n throw new CameraViewError(`Failed to capture photo: ${this.formatError(err)}`, 'FRAME_CAPTURE_ERROR');\n }\n }\n /**\n * Web implementation already uses images from the video stream, so this is the same as `capture()`\n */\n async captureSample(options) {\n return this.capture(options);\n }\n /**\n * Start recording video using MediaRecorder API\n */\n async startRecording(options) {\n if (!__classPrivateFieldGet(this, _CameraViewWeb_isRunning, \"f\") || !this.videoElement) {\n throw new CameraViewError('Camera is not running', 'SESSION_NOT_RUNNING');\n }\n if (this.mediaRecorder) {\n throw new CameraViewError('Recording is already in progress', 'RECORDING_ALREADY_IN_PROGRESS');\n }\n try {\n let stream = this.stream;\n // If audio is requested, get a new stream with audio track\n if ((options === null || options === void 0 ? void 0 : options.enableAudio) && stream) {\n const audioStream = await navigator.mediaDevices.getUserMedia({ audio: true });\n const audioTrack = audioStream.getAudioTracks()[0];\n this.recordingAudioTrack = audioTrack;\n const videoTracks = stream.getVideoTracks();\n stream = new MediaStream([...videoTracks, audioTrack]);\n }\n if (!stream) {\n throw new Error('No camera stream available');\n }\n this.recordedChunks = [];\n const mimeType = ['video/webm;codecs=vp9', 'video/webm', 'video/mp4'].find((type) => MediaRecorder.isTypeSupported(type));\n if (!mimeType) {\n throw new Error('No supported video recording format found');\n }\n this.mediaRecorder = new MediaRecorder(stream, { mimeType });\n this.mediaRecorder.ondataavailable = (event) => {\n if (event.data && event.data.size > 0) {\n this.recordedChunks.push(event.data);\n }\n };\n this.mediaRecorder.onstop = () => {\n var _a;\n // Stop audio track if it was added for recording\n if (this.recordingAudioTrack) {\n this.recordingAudioTrack.stop();\n this.recordingAudioTrack = null;\n }\n const blob = new Blob(this.recordedChunks, { type: mimeType });\n const url = URL.createObjectURL(blob);\n this.recordedChunks = [];\n this.mediaRecorder = null;\n (_a = this.recordingResolve) === null || _a === void 0 ? void 0 : _a.call(this, { webPath: url });\n this.recordingResolve = null;\n this.recordingReject = null;\n };\n this.mediaRecorder.onerror = (event) => {\n var _a, _b, _c;\n if (this.recordingAudioTrack) {\n this.recordingAudioTrack.stop();\n this.recordingAudioTrack = null;\n }\n this.mediaRecorder = null;\n this.recordedChunks = [];\n const errorMessage = (_b = (_a = event.error) === null || _a === void 0 ? void 0 : _a.message) !== null && _b !== void 0 ? _b : 'Unknown recording error';\n // A generic MediaRecorder runtime failure has no dedicated code, so\n // it falls back to UNKNOWN_ERROR per the plugin's documented\n // \"anything unmappable\" contract.\n (_c = this.recordingReject) === null || _c === void 0 ? void 0 : _c.call(this, new CameraViewError('Recording error: ' + errorMessage, 'UNKNOWN_ERROR'));\n this.recordingResolve = null;\n this.recordingReject = null;\n };\n this.mediaRecorder.start(100); // Collect data in 100ms chunks\n }\n catch (err) {\n if (this.recordingAudioTrack) {\n this.recordingAudioTrack.stop();\n this.recordingAudioTrack = null;\n }\n this.mediaRecorder = null;\n this.recordedChunks = [];\n throw new CameraViewError(`Failed to start recording: ${this.formatError(err)}`, this.mapRecordingStartErrorCode(err));\n }\n }\n /**\n * Maps a failure caught by `startRecording()`'s try/catch onto the closest-\n * fitting `CameraErrorCode`, without altering the existing wrapped message.\n *\n * A `DOMException` here can only come from the microphone `getUserMedia`\n * call, so it is classified with `kind: 'microphone'`. The two other\n * distinguishable failures are plain `Error`s matched by message text.\n */\n mapRecordingStartErrorCode(err) {\n if (err instanceof DOMException) {\n return classifyGetUserMediaErrorCode(err, 'microphone');\n }\n if (err instanceof Error) {\n if (err.message === 'No camera stream available') {\n return 'CAMERA_UNAVAILABLE';\n }\n if (err.message === 'No supported video recording format found') {\n return 'CONFIGURATION_FAILED';\n }\n }\n return 'UNKNOWN_ERROR';\n }\n /**\n * Stop the current video recording\n */\n async stopRecording() {\n if (!this.mediaRecorder) {\n throw new CameraViewError('No recording is in progress', 'NO_RECORDING_IN_PROGRESS');\n }\n // A stop is already pending. Reject this second call instead of\n // overwriting the pending callbacks, which would orphan the first caller's\n // promise forever.\n if (this.recordingResolve || this.recordingReject) {\n throw new CameraViewError('stopRecording() is already pending', 'UNKNOWN_ERROR');\n }\n return new Promise((resolve, reject) => {\n var _a;\n this.recordingResolve = resolve;\n this.recordingReject = reject;\n (_a = this.mediaRecorder) === null || _a === void 0 ? void 0 : _a.stop();\n });\n }\n /**\n * Flip between front and back camera\n */\n async flipCamera() {\n var _a;\n if (!__classPrivateFieldGet(this, _CameraViewWeb_isRunning, \"f\")) {\n throw new CameraViewError('Camera is not running', 'SESSION_NOT_RUNNING');\n }\n // Flipping restarts the stream and stops the tracks the MediaRecorder is\n // consuming, which would silently freeze an in-progress recording. Reject\n // instead so the caller can stop recording first; the recording stays\n // intact.\n if (this.mediaRecorder && this.mediaRecorder.state !== 'inactive') {\n throw new CameraViewError('Cannot flip camera while a recording is in progress', 'RECORDING_ALREADY_IN_PROGRESS');\n }\n // The candidate facing mode, kept local until the new stream is actually\n // live: `currentCamera` (and the previous stream) must not be touched\n // before that point, or a failed re-acquisition below would leave the\n // session state pointing at a camera that isn't running while the\n // previous camera's tracks have already been stopped.\n const nextCamera = this.currentCamera === 'user' ? 'environment' : 'user';\n // Acquire the new-facing stream with the new facing mode, keeping the\n // session's resolution/aspect-ratio constraints so the flipped stream\n // honors the same contract as the one it replaces.\n const constraints = {\n video: Object.assign(Object.assign({}, this.sessionResolutionConstraints), { facingMode: nextCamera }),\n audio: false,\n };\n let newStream;\n try {\n newStream = await navigator.mediaDevices.getUserMedia(constraints);\n }\n catch (err) {\n // Acquisition failed: `stream`/`currentCamera` haven't been touched, so\n // the previous camera is still attached and running. Just surface the\n // error. The only `getUserMedia` call in this method re-acquires the\n // camera (never the microphone), so classify with kind: 'camera'.\n throw new CameraViewError(`Failed to flip camera: ${this.formatError(err)}`, classifyGetUserMediaErrorCode(err, 'camera'));\n }\n // The new stream is live: safe to stop the previous stream's tracks and\n // commit the flipped state.\n (_a = this.stream) === null || _a === void 0 ? void 0 : _a.getTracks().forEach((track) => track.stop());\n this.stream = newStream;\n this.currentCamera = nextCamera;\n if (this.videoElement) {\n this.videoElement.srcObject = newStream;\n }\n // Re-apply the session's zoom level to the new stream through the normal\n // setZoom() path - a flip otherwise silently drops native-zoom's applied\n // constraint (reset on the fresh track) or leaves CSS-fallback's\n // transform stale against the fresh element state. Best-effort: a zoom\n // failure must not fail the flip itself.\n try {\n await this.setZoom({ level: this.currentZoom });\n }\n catch (err) {\n console.warn('[CameraView] Failed to re-apply zoom after flipping camera', err);\n }\n }\n /**\n * Get available camera devices.\n *\n * Position detection prefers the `facingMode` capability of the active video\n * track, since it is a standardized signal rather than a locale-dependent\n * string. Every other device falls back to matching the English word \"front\"\n * in `device.label` — which is empty for all devices until camera permission\n * has been granted once, so the fallback resolves to `'back'` in that case.\n */\n async getAvailableDevices() {\n var _a;\n try {\n const devices = await navigator.mediaDevices.enumerateDevices();\n const videoDevices = devices.filter((device) => device.kind === 'videoinput');\n const activeTrack = this.getVideoTrack();\n const activeDeviceId = activeTrack === null || activeTrack === void 0 ? void 0 : activeTrack.getSettings().deviceId;\n const activeFacingMode = activeTrack && typeof activeTrack.getCapabilities === 'function'\n ? (_a = activeTrack.getCapabilities().facingMode) === null || _a === void 0 ? void 0 : _a[0]\n : undefined;\n return {\n devices: videoDevices.map((device) => {\n const position = device.deviceId === activeDeviceId && activeFacingMode\n ? activeFacingMode === 'user'\n ? 'front'\n : 'back'\n : device.label.toLowerCase().includes('front')\n ? 'front'\n : 'back';\n return {\n id: device.deviceId,\n name: device.label || `Camera ${device.deviceId.substring(0, 5)}`,\n position,\n };\n }),\n };\n }\n catch (err) {\n console.error('Failed to get available devices', err);\n return { devices: [] };\n }\n }\n /**\n * Get current zoom information.\n *\n * When the active video track exposes a native `zoom` capability (Chromium\n * on capable cameras), the real min/max/current are reported. Otherwise the\n * simulated CSS-scale range is returned.\n */\n async getZoom() {\n const track = this.getVideoTrack();\n const capability = this.getNativeZoomCapability(track);\n if (track && capability) {\n const settings = track.getSettings();\n return {\n min: capability.min,\n max: capability.max,\n current: typeof settings.zoom === 'number' ? settings.zoom : this.currentZoom,\n };\n }\n // No native zoom: report the simulated CSS-scale range.\n return {\n min: SIMULATED_ZOOM_MIN,\n max: SIMULATED_ZOOM_MAX,\n current: this.currentZoom,\n };\n }\n /**\n * Set the zoom level.\n *\n * Prefers real zoom via `track.applyConstraints({ advanced: [{ zoom }] })`\n * when the browser exposes the native `zoom` capability, clamping to the\n * reported range. Falls back to a CSS `transform: scale()` simulation\n * otherwise.\n */\n async setZoom(options) {\n const track = this.getVideoTrack();\n const capability = this.getNativeZoomCapability(track);\n if (track && capability) {\n const clamped = Math.max(capability.min, Math.min(options.level, capability.max));\n await track.applyConstraints({ advanced: [{ zoom: clamped }] });\n this.currentZoom = clamped;\n this.usingNativeZoom = true;\n // Clear any CSS transform left over from a previous fallback so the two\n // zoom mechanisms can't stack.\n if (this.videoElement) {\n this.videoElement.style.transform = '';\n }\n return;\n }\n // CSS-transform fallback.\n this.usingNativeZoom = false;\n this.currentZoom = options.level;\n if (this.videoElement) {\n this.videoElement.style.transition = options.ramp ? 'transform 0.2s ease-in-out' : 'none';\n this.videoElement.style.transform = `scale(${this.getCssZoomScale()})`;\n this.videoElement.style.transformOrigin = 'center';\n }\n }\n /**\n * The video track backing the active stream, or `null`.\n */\n getVideoTrack() {\n var _a, _b;\n return (_b = (_a = this.stream) === null || _a === void 0 ? void 0 : _a.getVideoTracks()[0]) !== null && _b !== void 0 ? _b : null;\n }\n /**\n * Reads the native `zoom` capability off a track, if the browser both\n * supports `getCapabilities()` and exposes a usable `zoom` range on this\n * device. Returns `null` when native zoom is unavailable (CSS fallback).\n */\n getNativeZoomCapability(track) {\n if (!track || typeof track.getCapabilities !== 'function') {\n return null;\n }\n const zoom = track.getCapabilities().zoom;\n if (zoom && typeof zoom.min === 'number' && typeof zoom.max === 'number' && zoom.max > zoom.min) {\n return zoom;\n }\n return null;\n }\n /**\n * The effective CSS `transform: scale()` factor currently applied to the\n * preview: `1` when native zoom is in use (no transform), otherwise\n * `currentZoom` clamped to the simulated range. Used both to set the\n * transform and to compensate captures for it.\n */\n getCssZoomScale() {\n if (this.usingNativeZoom) {\n return 1;\n }\n return Math.max(SIMULATED_ZOOM_MIN, Math.min(this.currentZoom, SIMULATED_ZOOM_MAX));\n }\n /**\n * Set the focus/metering point (not supported in web).\n *\n * The `pointsOfInterest` media-track constraint has effectively no browser\n * support, so this rejects with `unimplemented` rather than silently doing\n * nothing. Left as a hook for a future implementation.\n */\n async setFocusPoint() {\n throw this.unimplemented('Focus point control is not supported in the web implementation.');\n }\n /**\n * Get current flash mode\n */\n async getFlashMode() {\n return { flashMode: this.currentFlashMode };\n }\n /**\n * Get supported flash modes\n */\n async getSupportedFlashModes() {\n // Web has limited flash control\n return { flashModes: ['off'] };\n }\n /**\n * Set flash mode (limited support in web).\n *\n * Only `'off'` is supported on web; any other mode rejects rather than\n * silently accepting a mode it cannot apply.\n */\n async setFlashMode(options) {\n if (options.mode !== 'off') {\n throw this.unimplemented('Flash mode control is not supported in the web implementation.');\n }\n this.currentFlashMode = 'off';\n }\n /**\n * Check if torch is available (not supported in web)\n */\n async isTorchAvailable() {\n // Torch is not supported in web implementation\n return { available: false };\n }\n /**\n * Get torch mode (not supported in web).\n *\n * Follows the documented contract for `getTorchMode()`: callers must check\n * `isTorchAvailable()` first, which always reports `false` on web, so this throws\n * rather than returning a fabricated \"off\" state.\n */\n async getTorchMode() {\n throw this.unimplemented('Torch control is not supported in web implementation.');\n }\n /**\n * Set torch mode (not supported in web)\n */\n async setTorchMode() {\n // Torch is not supported in web implementation\n throw this.unimplemented('Torch control is not supported in web implementation.');\n }\n /**\n * Check camera and microphone permission without requesting\n */\n async checkPermissions() {\n const [camera, microphone] = await Promise.all([\n this.checkSinglePermission('camera'),\n this.checkSinglePermission('microphone'),\n ]);\n return { camera, microphone };\n }\n /**\n * Resolves the current state of a single permission.\n *\n * Queried independently per permission name so one unsupported query (e.g.\n * Firefox does not support querying `'microphone'`) rejects on its own\n * instead of collapsing *both* permissions to `'prompt'`.\n */\n async checkSinglePermission(name) {\n if (navigator.permissions) {\n try {\n const result = await navigator.permissions.query({ name: name });\n return result.state === 'granted' ? 'granted' : result.state === 'denied' ? 'denied' : 'prompt';\n }\n catch (_a) {\n // This permission name is not supported by the Permissions API in this\n // browser; fall through to the best-effort fallback below instead of\n // failing the other permission's check too.\n }\n }\n // If the Permissions API is unavailable/unsupported for this name, fall back to\n // checking the active stream for camera; there is no equivalent signal for\n // microphone without an active audio track, so it stays 'prompt'.\n if (name === 'camera') {\n return this.stream ? 'granted' : 'prompt';\n }\n return 'prompt';\n }\n /**\n * Request camera and/or microphone permissions from the user.\n * By default, only camera permission is requested.\n */\n async requestPermissions(options) {\n var _a;\n const permissions = (_a = options === null || options === void 0 ? void 0 : options.permissions) !== null && _a !== void 0 ? _a : ['camera'];\n const result = { camera: 'prompt', microphone: 'prompt' };\n // Request camera permission if included\n if (permissions.includes('camera')) {\n try {\n const stream = await navigator.mediaDevices.getUserMedia({ video: true });\n stream.getTracks().forEach((track) => track.stop());\n result.camera = 'granted';\n }\n catch (_b) {\n result.camera = 'denied';\n }\n }\n else {\n // Still report current status even if not requesting\n result.camera = (await this.checkPermissions()).camera;\n }\n // Request microphone permission only if explicitly included\n if (permissions.includes('microphone')) {\n try {\n const stream = await navigator.mediaDevices.getUserMedia({ audio: true });\n stream.getTracks().forEach((track) => track.stop());\n result.microphone = 'granted';\n }\n catch (_c) {\n result.microphone = 'denied';\n }\n }\n else {\n result.microphone = (await this.checkPermissions()).microphone;\n }\n return result;\n }\n /**\n * Start barcode detection if supported\n */\n async startBarcodeDetection() {\n var _a;\n const barcodeDetector = this.barcodeDetector;\n const videoElement = this.videoElement;\n if (!this.barcodeDetectionSupported || !barcodeDetector || !videoElement) {\n return;\n }\n // Scope this loop to its own session. Aborting the previous controller\n // (defensive - start() only calls in here once per session) and handing\n // out a fresh signal means a stale detectFrame closure from an earlier\n // session can never mistake a later session's #isRunning === true for\n // its own \"keep going\" signal.\n (_a = this.barcodeDetectionAbortController) === null || _a === void 0 ? void 0 : _a.abort();\n const abortController = new AbortController();\n this.barcodeDetectionAbortController = abortController;\n const { signal } = abortController;\n // Make sure video is fully loaded before starting detection. The wait\n // settles - without starting detection - as soon as the session is\n // stopped (`signal` aborts), and a timeout backstops the case where the\n // video never fires `loadeddata` at all, so neither path leaves a\n // dangling listener or a permanently pending promise.\n if (videoElement.readyState < 2) {\n const videoReady = await new Promise((resolve) => {\n const cleanup = () => {\n videoElement.removeEventListener('loadeddata', loadHandler);\n signal.removeEventListener('abort', abortHandler);\n clearTimeout(timeoutId);\n };\n const loadHandler = () => {\n cleanup();\n resolve(true);\n };\n const abortHandler = () => {\n cleanup();\n resolve(false);\n };\n const timeoutId = setTimeout(() => {\n cleanup();\n resolve(false);\n }, BARCODE_VIDEO_READY_TIMEOUT_MS);\n videoElement.addEventListener('loadeddata', loadHandler);\n signal.addEventListener('abort', abortHandler);\n });\n if (!videoReady || signal.aborted) {\n return;\n }\n }\n if (signal.aborted) {\n return;\n }\n // Add throttling to reduce CPU usage\n let lastDetectionTime = 0;\n const minTimeBetweenDetections = 100; // ms\n // Dedupe state: timestamps of recently emitted barcodes keyed by value +\n // type. A per-key map (rather than a single \"last\" slot) is required so\n // multiple codes in frame can't alternate and defeat the suppression\n // window. Closure-local, so it resets on every start().\n const recentBarcodeEmitTimes = new Map();\n // Set up periodic frame analysis for barcode detection\n const detectFrame = async () => {\n var _a;\n // `signal.aborted` is this loop's own session check: it stays true for\n // this closure even if a rapid stop() -> start() flips #isRunning back\n // to true for a *new* session before this frame runs. `#isRunning` is\n // kept as a defensive secondary check.\n if (signal.aborted || !__classPrivateFieldGet(this, _CameraViewWeb_isRunning, \"f\") || !videoElement || !barcodeDetector) {\n return;\n }\n // Monotonic clock: a backward wall-clock jump must not extend the\n // throttle or suppression windows arbitrarily.\n const now = performance.now();\n if (now - lastDetectionTime >= minTimeBetweenDetections) {\n try {\n const barcodes = await barcodeDetector.detect(videoElement);\n lastDetectionTime = now;\n if (barcodes.length > 0) {\n const barcode = barcodes[0];\n // Normalize the web BarcodeDetector format onto the shared BarcodeType\n // vocabulary. Fall back to the raw format for the few detector formats\n // that have no BarcodeType equivalent (e.g. 'unknown'); the emitted\n // `type` is therefore `BarcodeType | string`.\n const type = (_a = WEB_FORMAT_TO_BARCODE_TYPE[barcode.format]) !== null && _a !== void 0 ? _a : barcode.format;\n // Rate control: suppress re-emission of the same code (value + type)\n // within the suppression window. A genuinely new code has a different\n // key and emits immediately. Timestamps are tracked per key so\n // multiple codes in frame can't alternate and defeat the window.\n const barcodeKey = `${type}\\u0000${barcode.rawValue}`;\n const lastEmit = recentBarcodeEmitTimes.get(barcodeKey);\n if (lastEmit === undefined || now - lastEmit >= BARCODE_SUPPRESSION_WINDOW_MS) {\n // Prune expired entries once the map grows, keeping it bounded\n // during long sessions that scan many different codes.\n if (recentBarcodeEmitTimes.size > BARCODE_DEDUPE_MAP_PRUNE_THRESHOLD) {\n for (const [key, emitTime] of recentBarcodeEmitTimes) {\n if (now - emitTime >= BARCODE_SUPPRESSION_WINDOW_MS) {\n recentBarcodeEmitTimes.delete(key);\n }\n }\n }\n recentBarcodeEmitTimes.set(barcodeKey, now);\n // Transform barcode coordinates using the utility function,\n // accounting for the session's preview scale mode (cover crops,\n // fit letterboxes) so the rect lands over the on-screen barcode.\n const boundingRect = transformBarcodeBoundingBox(barcode.boundingBox, videoElement, this.sessionPreviewScaleMode);\n this.notifyListeners('barcodeDetected', {\n value: barcode.rawValue,\n type,\n boundingRect,\n });\n }\n }\n }\n catch (err) {\n console.error('Barcode detection error', err);\n }\n }\n if (!signal.aborted && __classPrivateFieldGet(this, _CameraViewWeb_isRunning, \"f\")) {\n this.barcodeAnimationFrameId = requestAnimationFrame(detectFrame);\n }\n };\n this.barcodeAnimationFrameId = requestAnimationFrame(detectFrame);\n }\n /**\n * Check if barcode detection is supported in this browser\n */\n async checkBarcodeDetectionSupport() {\n if ('BarcodeDetector' in window) {\n try {\n this.barcodeDetector = new BarcodeDetector();\n this.barcodeDetectionSupported = true;\n }\n catch (e) {\n console.warn('BarcodeDetector is not supported by this browser.');\n this.barcodeDetectionSupported = false;\n }\n }\n }\n /**\n * Configure the barcode detector with requested barcode formats.\n * Unsupported formats are ignored and logged.\n */\n async configureBarcodeDetector(barcodeTypes) {\n if (!this.barcodeDetectionSupported) {\n return;\n }\n if (!(barcodeTypes === null || barcodeTypes === void 0 ? void 0 : barcodeTypes.length)) {\n this.barcodeDetector = new BarcodeDetector();\n return;\n }\n const requestedFormats = barcodeTypes\n .map((barcodeType) => {\n const webFormat = BARCODE_TYPE_TO_WEB_FORMAT[barcodeType];\n if (!webFormat) {\n console.warn(`[CameraView] Barcode type \"${barcodeType}\" is not supported by the web BarcodeDetector API.`);\n }\n return webFormat;\n })\n .filter((format) => format !== null);\n if (!requestedFormats.length) {\n console.warn('[CameraView] No requested barcode types are supported on web. Falling back to all supported formats.');\n this.barcodeDetector = new BarcodeDetector();\n return;\n }\n const uniqueRequestedFormats = Array.from(new Set(requestedFormats));\n try {\n const supportedFormats = await BarcodeDetector.getSupportedFormats();\n const configuredFormats = uniqueRequestedFormats.filter((format) => supportedFormats.includes(format));\n const ignoredFormats = uniqueRequestedFormats.filter((format) => !supportedFormats.includes(format));\n if (ignoredFormats.length) {\n console.warn(`[CameraView] Ignoring unsupported barcode formats for this browser: ${ignoredFormats.join(', ')}.`);\n }\n if (!configuredFormats.length) {\n console.warn('[CameraView] No requested barcode formats are available in this browser. Falling back to all supported formats.');\n this.barcodeDetector = new BarcodeDetector();\n return;\n }\n this.barcodeDetector = new BarcodeDetector({ formats: configuredFormats });\n }\n catch (error) {\n console.warn('[CameraView] Failed to resolve supported barcode formats; falling back to unfiltered detector.', error);\n this.barcodeDetector = new BarcodeDetector();\n }\n }\n /**\n * Set up the video element for the camera view\n */\n async setupVideoElement(containerElementId) {\n this.videoElement = document.createElement('video');\n this.videoElement.playsInline = true;\n this.videoElement.autoplay = true;\n this.videoElement.muted = true;\n this.videoElement.style.width = '100%';\n this.videoElement.style.height = '100%';\n this.videoElement.style.objectFit = 'cover';\n // If a container ID is provided, find that element and append the video to it\n if (containerElementId) {\n const container = document.getElementById(containerElementId);\n if (!container) {\n throw new Error(`Container element with ID ${containerElementId} not found`);\n }\n container.appendChild(this.videoElement);\n }\n else {\n // Otherwise, append to body as fallback\n document.body.appendChild(this.videoElement);\n }\n }\n /**\n * Ensures canvas element exists and returns it\n */\n getCanvasElement() {\n if (!this.canvasElement) {\n this.canvasElement = document.createElement('canvas');\n }\n return this.canvasElement;\n }\n /**\n * Format error message\n */\n formatError(err) {\n return err instanceof Error ? err.message : String(err);\n }\n}\n_CameraViewWeb_isRunning = new WeakMap();\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","this","WebPlugin"],"mappings":";;;IACA;IACA;IACA;AACK,UAAC,UAAU,GAAGA,mBAAc,CAAC,YAAY,EAAE;IAChD,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,aAAa,EAAE,CAAC;IACjE,CAAC;;ICND;IACA;IACA;IACO,SAAS,cAAc,CAAC,MAAM,EAAE,OAAO,EAAE;IAChD,IAAI,MAAM,OAAO,GAAG,MAAM,CAAC,SAAS,CAAC,YAAY,EAAE,OAAO,CAAC;IAC3D,IAAI,OAAO,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IAChC;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACO,SAAS,oBAAoB,CAAC,KAAK,EAAE;IAC5C;IACA,IAAI,MAAM,SAAS,GAAG,KAAK,CAAC,qBAAqB,EAAE;IACnD,IAAI,MAAM,YAAY,GAAG,SAAS,CAAC,KAAK;IACxC,IAAI,MAAM,aAAa,GAAG,SAAS,CAAC,MAAM;IAC1C;IACA,IAAI,MAAM,UAAU,GAAG,KAAK,CAAC,UAAU;IACvC,IAAI,MAAM,WAAW,GAAG,KAAK,CAAC,WAAW;IACzC;IACA,IAAI,MAAM,WAAW,GAAG,UAAU,GAAG,WAAW;IAChD,IAAI,MAAM,aAAa,GAAG,YAAY,GAAG,aAAa;IACtD,IAAI,IAAI,OAAO,GAAG,CAAC;IACnB,IAAI,IAAI,OAAO,GAAG,CAAC;IACnB,IAAI,IAAI,WAAW,GAAG,UAAU;IAChC,IAAI,IAAI,YAAY,GAAG,WAAW;IAClC;IACA;IAC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,CAAC;IACzE,YAAY,IAAI,CAAC,SAAS,EAAE;IAC5B,gBAAgB,MAAM,IAAI,KAAK,CAAC,CAAC,0BAA0B,EAAE,kBAAkB,CAAC,UAAU,CAAC,CAAC;IAC5F,YAAY;IACZ,YAAY,SAAS,CAAC,WAAW,CAAC,IAAI,CAAC,YAAY,CAAC;IACpD,QAAQ;IACR,aAAa;IACb;IACA,YAAY,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,YAAY,CAAC;IACxD,QAAQ;IACR,IAAI;IACJ;IACA;IACA;IACA,IAAI,gBAAgB,GAAG;IACvB,QAAQ,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE;IACjC,YAAY,IAAI,CAAC,aAAa,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC;IACjE,QAAQ;IACR,QAAQ,OAAO,IAAI,CAAC,aAAa;IACjC,IAAI;IACJ;IACA;IACA;IACA,IAAI,WAAW,CAAC,GAAG,EAAE;IACrB,QAAQ,OAAO,GAAG,YAAY,KAAK,GAAG,GAAG,CAAC,OAAO,GAAG,MAAM,CAAC,GAAG,CAAC;IAC/D,IAAI;IACJ;IACA,wBAAwB,GAAG,IAAI,OAAO,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -11,16 +11,26 @@ enum CameraError: Error, LocalizedError, CustomNSError {
11
11
  case photoOutputError
12
12
  case photoOutputNotConfigured
13
13
  case sessionNotRunning
14
+ case sessionAlreadyRunning
14
15
  case unsupportedFlashMode
15
16
  case torchUnavailable
16
17
  case zoomFactorOutOfRange
18
+ case focusNotSupported
17
19
  case permissionDenied
18
20
  case deviceLocked
19
21
  case recordingAlreadyInProgress
20
22
  case noRecordingInProgress
21
23
  case audioDeviceUnavailable
22
24
  case audioInputAdditionFailed
23
-
25
+ case captureInProgress
26
+ case captureTimeout
27
+ case missingWebView
28
+ case invalidArgument
29
+ case imageCompressionFailed
30
+ case pathConversionFailed
31
+ case fileWriteFailed
32
+ case captureOutputMissing
33
+
24
34
  // MARK: - CustomNSError
25
35
 
26
36
  static var errorDomain: String {
@@ -45,12 +55,16 @@ enum CameraError: Error, LocalizedError, CustomNSError {
45
55
  return 1007
46
56
  case .sessionNotRunning:
47
57
  return 1008
58
+ case .sessionAlreadyRunning:
59
+ return 1027
48
60
  case .unsupportedFlashMode:
49
61
  return 1009
50
62
  case .torchUnavailable:
51
63
  return 1010
52
64
  case .zoomFactorOutOfRange:
53
65
  return 1011
66
+ case .focusNotSupported:
67
+ return 1026
54
68
  case .permissionDenied:
55
69
  return 1012
56
70
  case .deviceLocked:
@@ -63,9 +77,90 @@ enum CameraError: Error, LocalizedError, CustomNSError {
63
77
  return 1016
64
78
  case .audioInputAdditionFailed:
65
79
  return 1017
80
+ case .captureInProgress:
81
+ return 1018
82
+ case .captureTimeout:
83
+ return 1019
84
+ case .missingWebView:
85
+ return 1020
86
+ case .invalidArgument:
87
+ return 1021
88
+ case .imageCompressionFailed:
89
+ return 1022
90
+ case .pathConversionFailed:
91
+ return 1023
92
+ case .fileWriteFailed:
93
+ return 1024
94
+ case .captureOutputMissing:
95
+ return 1025
66
96
  }
67
97
  }
68
-
98
+
99
+ /// A stable, platform-independent string code identifying this error.
100
+ ///
101
+ /// Unlike `errorCode`, this value is part of the plugin's public JS/TS
102
+ /// contract: consumers can `switch` on `error.code` from a rejected
103
+ /// promise. Where the same failure class exists on Android, the string
104
+ /// matches the one Android emits.
105
+ var code: String {
106
+ switch self {
107
+ case .cameraUnavailable:
108
+ return "CAMERA_UNAVAILABLE"
109
+ case .configurationFailed:
110
+ return "CONFIGURATION_FAILED"
111
+ case .frameCaptureError:
112
+ return "FRAME_CAPTURE_ERROR"
113
+ case .inputAdditionFailed:
114
+ return "INPUT_ADDITION_FAILED"
115
+ case .outputAdditionFailed:
116
+ return "OUTPUT_ADDITION_FAILED"
117
+ case .photoOutputError:
118
+ return "PHOTO_OUTPUT_ERROR"
119
+ case .photoOutputNotConfigured:
120
+ return "PHOTO_OUTPUT_NOT_CONFIGURED"
121
+ case .sessionNotRunning:
122
+ return "SESSION_NOT_RUNNING"
123
+ case .sessionAlreadyRunning:
124
+ return "SESSION_ALREADY_RUNNING"
125
+ case .unsupportedFlashMode:
126
+ return "UNSUPPORTED_FLASH_MODE"
127
+ case .torchUnavailable:
128
+ return "TORCH_UNAVAILABLE"
129
+ case .zoomFactorOutOfRange:
130
+ return "ZOOM_FACTOR_OUT_OF_RANGE"
131
+ case .focusNotSupported:
132
+ return "FOCUS_NOT_SUPPORTED"
133
+ case .permissionDenied:
134
+ return "PERMISSION_DENIED"
135
+ case .deviceLocked:
136
+ return "DEVICE_LOCKED"
137
+ case .recordingAlreadyInProgress:
138
+ return "RECORDING_ALREADY_IN_PROGRESS"
139
+ case .noRecordingInProgress:
140
+ return "NO_RECORDING_IN_PROGRESS"
141
+ case .audioDeviceUnavailable:
142
+ return "AUDIO_DEVICE_UNAVAILABLE"
143
+ case .audioInputAdditionFailed:
144
+ return "AUDIO_INPUT_ADDITION_FAILED"
145
+ case .captureInProgress:
146
+ return "CAPTURE_IN_PROGRESS"
147
+ case .captureTimeout:
148
+ return "CAPTURE_TIMEOUT"
149
+ case .missingWebView:
150
+ return "WEBVIEW_UNAVAILABLE"
151
+ case .invalidArgument:
152
+ return "INVALID_ARGUMENT"
153
+ case .imageCompressionFailed:
154
+ return "IMAGE_COMPRESSION_FAILED"
155
+ case .pathConversionFailed:
156
+ return "PATH_CONVERSION_FAILED"
157
+ case .fileWriteFailed:
158
+ return "FILE_WRITE_FAILED"
159
+ case .captureOutputMissing:
160
+ return "CAPTURE_OUTPUT_MISSING"
161
+ }
162
+ }
163
+
69
164
  var errorUserInfo: [String: Any] {
70
165
  var userInfo: [String: Any] = [
71
166
  NSLocalizedDescriptionKey: errorDescription ?? "Unknown error"
@@ -102,12 +197,16 @@ enum CameraError: Error, LocalizedError, CustomNSError {
102
197
  return "The photo output has not been configured."
103
198
  case .sessionNotRunning:
104
199
  return "The capture session is not currently running."
200
+ case .sessionAlreadyRunning:
201
+ return "A camera session is already running."
105
202
  case .unsupportedFlashMode:
106
203
  return "The requested flash mode is not supported by the current camera."
107
204
  case .torchUnavailable:
108
205
  return "Torch is not available on this device."
109
206
  case .zoomFactorOutOfRange:
110
207
  return "The requested zoom factor is out of range."
208
+ case .focusNotSupported:
209
+ return "The current camera does not support focus or exposure at a point of interest."
111
210
  case .permissionDenied:
112
211
  return "Camera access has been denied."
113
212
  case .deviceLocked:
@@ -120,6 +219,22 @@ enum CameraError: Error, LocalizedError, CustomNSError {
120
219
  return "No microphone is available on this device."
121
220
  case .audioInputAdditionFailed:
122
221
  return "Failed to add the microphone input to the capture session."
222
+ case .captureInProgress:
223
+ return "A capture is already in progress."
224
+ case .captureTimeout:
225
+ return "Timed out waiting for a camera frame."
226
+ case .missingWebView:
227
+ return "Could not find the web view to render the camera preview into."
228
+ case .invalidArgument:
229
+ return "An invalid argument was provided."
230
+ case .imageCompressionFailed:
231
+ return "Failed to compress the captured image."
232
+ case .pathConversionFailed:
233
+ return "Failed to create a web-accessible path for the file."
234
+ case .fileWriteFailed:
235
+ return "Failed to write the file to disk."
236
+ case .captureOutputMissing:
237
+ return "The capture completed but produced no output data."
123
238
  }
124
239
  }
125
240
 
@@ -142,12 +257,16 @@ enum CameraError: Error, LocalizedError, CustomNSError {
142
257
  return "Start the camera session before attempting to capture a photo."
143
258
  case .sessionNotRunning:
144
259
  return "Call start() to begin the camera session before using this feature."
260
+ case .sessionAlreadyRunning:
261
+ return "Call stop() before starting a new camera session."
145
262
  case .unsupportedFlashMode:
146
263
  return "Use getSupportedFlashModes() to check available flash modes for this camera."
147
264
  case .torchUnavailable:
148
265
  return "This device or camera position does not support torch functionality."
149
266
  case .zoomFactorOutOfRange:
150
267
  return "Use getZoom() to check the supported zoom range for this camera."
268
+ case .focusNotSupported:
269
+ return "This camera has a fixed focus and does not support tap-to-focus."
151
270
  case .permissionDenied:
152
271
  return "Go to Settings > Privacy > Camera and enable access for this app."
153
272
  case .deviceLocked:
@@ -160,6 +279,32 @@ enum CameraError: Error, LocalizedError, CustomNSError {
160
279
  return "Ensure the device has a microphone and that microphone access has been granted."
161
280
  case .audioInputAdditionFailed:
162
281
  return "The microphone may be in use by another application. Close other apps and try again."
282
+ case .captureInProgress:
283
+ return "Wait for the current capture to finish before starting a new one."
284
+ case .captureTimeout:
285
+ return "Ensure the camera session is running and not interrupted, then try again."
286
+ case .missingWebView:
287
+ return "Ensure the plugin is attached to a Capacitor bridge with a valid web view."
288
+ case .invalidArgument:
289
+ return nil
290
+ case .imageCompressionFailed:
291
+ return "Try capturing again or use a different quality setting."
292
+ case .pathConversionFailed:
293
+ return "Ensure the Capacitor bridge is available and try again."
294
+ case .fileWriteFailed:
295
+ return "Ensure the device has available storage and try again."
296
+ case .captureOutputMissing:
297
+ return "Try the operation again. If the issue persists, restart the camera session."
163
298
  }
164
299
  }
165
300
  }
301
+
302
+ extension Error {
303
+ /// The stable string code to surface in a Capacitor `call.reject`.
304
+ ///
305
+ /// Falls back to a generic code for errors that are not a `CameraError`
306
+ /// (e.g. file-system errors from writing a captured file to disk).
307
+ var cameraErrorCode: String {
308
+ (self as? CameraError)?.code ?? "UNKNOWN_ERROR"
309
+ }
310
+ }