capacitor-camera-view 2.2.0-rc.1 → 2.2.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.
- package/README.md +17 -202
- package/android/build.gradle +0 -1
- package/android/src/main/AndroidManifest.xml +0 -1
- package/android/src/main/java/com/michaelwolz/capacitorcameraview/CameraView.kt +4 -287
- package/android/src/main/java/com/michaelwolz/capacitorcameraview/CameraViewPlugin.kt +8 -112
- package/android/src/main/java/com/michaelwolz/capacitorcameraview/model/BarcodeDetectionResult.kt +1 -0
- package/android/src/main/java/com/michaelwolz/capacitorcameraview/utils.kt +1 -21
- package/dist/docs.json +21 -201
- package/dist/esm/definitions.d.ts +23 -85
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/web.d.ts +4 -20
- package/dist/esm/web.js +16 -151
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +16 -151
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +16 -151
- package/dist/plugin.js.map +1 -1
- package/ios/Sources/CameraViewPlugin/CameraError.swift +0 -28
- package/ios/Sources/CameraViewPlugin/CameraEvents.swift +27 -3
- package/ios/Sources/CameraViewPlugin/CameraSessionConfiguration.swift +8 -8
- package/ios/Sources/CameraViewPlugin/CameraViewManager+BarcodeScan.swift +34 -3
- package/ios/Sources/CameraViewPlugin/CameraViewManager+PhotoCapture.swift +14 -13
- package/ios/Sources/CameraViewPlugin/CameraViewManager.swift +150 -159
- package/ios/Sources/CameraViewPlugin/CameraViewPlugin.swift +15 -114
- package/ios/Sources/CameraViewPlugin/TempFileManager.swift +34 -68
- package/package.json +12 -12
- package/android/src/main/java/com/michaelwolz/capacitorcameraview/model/VideoRecordingQuality.kt +0 -10
- package/ios/Sources/CameraViewPlugin/CameraViewManager+VideoRecording.swift +0 -302
package/dist/plugin.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.cjs.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 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 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":";;;;AACA;AACA;AACA;AACK,MAAC,UAAU,GAAGA,mBAAc,CAAC,YAAY,EAAE;AAChD,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,aAAa,EAAE,CAAC;AACjE,CAAC;;ACND;AACA;AACA;AACO,SAAS,cAAc,CAAC,MAAM,EAAE,OAAO,EAAE;AAChD,IAAI,MAAM,OAAO,GAAG,MAAM,CAAC,SAAS,CAAC,YAAY,EAAE,OAAO,CAAC;AAC3D,IAAI,OAAO,OAAO,CAAC,KAAK,CAAC,GAAG,CAA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nD;AACA,QAAQ,IAAI,kBAAkB,EAAE;AAChC,YAAY,MAAM,SAAS,GAAG,QAAQ,CAAC,cAAc,CAAC,kBAAkB,CAAC;AACzE,YAAY,IAAI,CAAC,SAAS,EAAE;AAC5B,gBAAgB,MAAM,IAAI,KAAK,CAAC,CAAC,0BAA0B,EAAE,kBAAkB,CAAC,UAAU,CAAC,CAAC;AAC5F,YAAY;AACZ,YAAY,SAAS,CAAC,WAAW,CAAC,IAAI,CAAC,YAAY,CAAC;AACpD,QAAQ;AACR,aAAa;AACb;AACA,YAAY,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,YAAY,CAAC;AACxD,QAAQ;AACR,IAAI;AACJ;AACA;AACA;AACA,IAAI,gBAAgB,GAAG;AACvB,QAAQ,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE;AACjC,YAAY,IAAI,CAAC,aAAa,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC;AACjE,QAAQ;AACR,QAAQ,OAAO,IAAI,CAAC,aAAa;AACjC,IAAI;AACJ;AACA;AACA;AACA,IAAI,WAAW,CAAC,GAAG,EAAE;AACrB,QAAQ,OAAO,GAAG,YAAY,KAAK,GAAG,GAAG,CAAC,OAAO,GAAG,MAAM,CAAC,GAAG,CAAC;AAC/D,IAAI;AACJ;AACA,wBAAwB,GAAG,IAAI,OAAO,EAAE;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"plugin.cjs.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 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 if (!__classPrivateFieldGet(this, _CameraViewWeb_isRunning, \"f\")) {\n return;\n }\n try {\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 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 * 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 permission without requesting\n */\n async checkPermissions() {\n try {\n // Use Permissions API if available\n if (navigator.permissions) {\n const result = await navigator.permissions.query({ name: 'camera' });\n return {\n camera: result.state === 'granted' ? 'granted' : result.state === 'denied' ? 'denied' : 'prompt',\n };\n }\n // If Permissions API is not available, check if we have an active stream\n return {\n camera: this.stream ? 'granted' : 'prompt',\n };\n }\n catch (err) {\n // If permissions API is not supported or fails\n return {\n camera: 'prompt',\n };\n }\n }\n /**\n * Request camera permission from the user\n */\n async requestPermissions() {\n try {\n // Try to access the camera to trigger the permission prompt\n const stream = await navigator.mediaDevices.getUserMedia({ video: true });\n // If we get here, permission was granted\n // Clean up the test stream\n stream.getTracks().forEach((track) => track.stop());\n return { camera: 'granted' };\n }\n catch (err) {\n // Permission denied or other error\n return { camera: 'denied' };\n }\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":";;;;AACA;AACA;AACA;AACK,MAAC,UAAU,GAAGA,mBAAc,CAAC,YAAY,EAAE;AAChD,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,aAAa,EAAE,CAAC;AACjE,CAAC;;ACND;AACA;AACA;AACO,SAAS,cAAc,CAAC,MAAM,EAAE,OAAO,EAAE;AAChD,IAAI,MAAM,OAAO,GAAG,MAAM,CAAC,SAAS,CAAC,YAAY,EAAE,OAAO,CAAC;AAC3D,IAAI,OAAO,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AAChC;AACA;AACA;AACA;AACO,SAAS,oBAAoB,CAAC,KAAK,EAAE;AAC5C;AACA,IAAI,MAAM,SAAS,GAAG,KAAK,CAAC,qBAAqB,EAAE;AACnD,IAAI,MAAM,YAAY,GAAG,SAAS,CAAC,KAAK;AACxC,IAAI,MAAM,aAAa,GAAG,SAAS,CAAC,MAAM;AAC1C;AACA,IAAI,MAAM,UAAU,GAAG,KAAK,CAAC,UAAU;AACvC,IAAI,MAAM,WAAW,GAAG,KAAK,CAAC,WAAW;AACzC;AACA,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IAAI;AACJ;AACA,wBAAwB,GAAG,IAAI,OAAO,EAAE;;;;;;;;;;"}
|
package/dist/plugin.js
CHANGED
|
@@ -163,12 +163,6 @@ var capacitorCameraView = (function (exports, core) {
|
|
|
163
163
|
// Barcode detection support
|
|
164
164
|
this.barcodeDetectionSupported = false;
|
|
165
165
|
this.barcodeDetector = null;
|
|
166
|
-
// Recording state
|
|
167
|
-
this.mediaRecorder = null;
|
|
168
|
-
this.recordedChunks = [];
|
|
169
|
-
this.recordingAudioTrack = null;
|
|
170
|
-
this.recordingResolve = null;
|
|
171
|
-
this.recordingReject = null;
|
|
172
166
|
this.checkBarcodeDetectionSupport();
|
|
173
167
|
}
|
|
174
168
|
/**
|
|
@@ -228,25 +222,10 @@ var capacitorCameraView = (function (exports, core) {
|
|
|
228
222
|
* Stop the camera and release resources
|
|
229
223
|
*/
|
|
230
224
|
async stop() {
|
|
231
|
-
var _a;
|
|
232
225
|
if (!__classPrivateFieldGet(this, _CameraViewWeb_isRunning, "f")) {
|
|
233
226
|
return;
|
|
234
227
|
}
|
|
235
228
|
try {
|
|
236
|
-
// Stop any active recording
|
|
237
|
-
if (this.mediaRecorder && this.mediaRecorder.state !== 'inactive') {
|
|
238
|
-
// Reject any pending stopRecording promise since we're force-stopping
|
|
239
|
-
(_a = this.recordingReject) === null || _a === void 0 ? void 0 : _a.call(this, new Error('Camera session stopped while recording'));
|
|
240
|
-
this.recordingResolve = null;
|
|
241
|
-
this.recordingReject = null;
|
|
242
|
-
this.mediaRecorder.stop();
|
|
243
|
-
this.mediaRecorder = null;
|
|
244
|
-
}
|
|
245
|
-
this.recordedChunks = [];
|
|
246
|
-
if (this.recordingAudioTrack) {
|
|
247
|
-
this.recordingAudioTrack.stop();
|
|
248
|
-
this.recordingAudioTrack = null;
|
|
249
|
-
}
|
|
250
229
|
// Stop all tracks in the stream
|
|
251
230
|
if (this.stream) {
|
|
252
231
|
this.stream.getTracks().forEach((track) => track.stop());
|
|
@@ -311,88 +290,6 @@ var capacitorCameraView = (function (exports, core) {
|
|
|
311
290
|
async captureSample(options) {
|
|
312
291
|
return this.capture(options);
|
|
313
292
|
}
|
|
314
|
-
/**
|
|
315
|
-
* Start recording video using MediaRecorder API
|
|
316
|
-
*/
|
|
317
|
-
async startRecording(options) {
|
|
318
|
-
if (!__classPrivateFieldGet(this, _CameraViewWeb_isRunning, "f") || !this.videoElement) {
|
|
319
|
-
throw new Error('Camera is not running');
|
|
320
|
-
}
|
|
321
|
-
if (this.mediaRecorder) {
|
|
322
|
-
throw new Error('Recording is already in progress');
|
|
323
|
-
}
|
|
324
|
-
try {
|
|
325
|
-
let stream = this.stream;
|
|
326
|
-
// If audio is requested, get a new stream with audio track
|
|
327
|
-
if ((options === null || options === void 0 ? void 0 : options.enableAudio) && stream) {
|
|
328
|
-
const audioStream = await navigator.mediaDevices.getUserMedia({ audio: true });
|
|
329
|
-
const audioTrack = audioStream.getAudioTracks()[0];
|
|
330
|
-
this.recordingAudioTrack = audioTrack;
|
|
331
|
-
const videoTracks = stream.getVideoTracks();
|
|
332
|
-
stream = new MediaStream([...videoTracks, audioTrack]);
|
|
333
|
-
}
|
|
334
|
-
if (!stream) {
|
|
335
|
-
throw new Error('No camera stream available');
|
|
336
|
-
}
|
|
337
|
-
this.recordedChunks = [];
|
|
338
|
-
const mimeType = ['video/webm;codecs=vp9', 'video/webm', 'video/mp4'].find((type) => MediaRecorder.isTypeSupported(type));
|
|
339
|
-
if (!mimeType) {
|
|
340
|
-
throw new Error('No supported video recording format found');
|
|
341
|
-
}
|
|
342
|
-
this.mediaRecorder = new MediaRecorder(stream, { mimeType });
|
|
343
|
-
this.mediaRecorder.ondataavailable = (event) => {
|
|
344
|
-
if (event.data && event.data.size > 0) {
|
|
345
|
-
this.recordedChunks.push(event.data);
|
|
346
|
-
}
|
|
347
|
-
};
|
|
348
|
-
this.mediaRecorder.onstop = () => {
|
|
349
|
-
var _a;
|
|
350
|
-
// Stop audio track if it was added for recording
|
|
351
|
-
if (this.recordingAudioTrack) {
|
|
352
|
-
this.recordingAudioTrack.stop();
|
|
353
|
-
this.recordingAudioTrack = null;
|
|
354
|
-
}
|
|
355
|
-
const blob = new Blob(this.recordedChunks, { type: mimeType });
|
|
356
|
-
const url = URL.createObjectURL(blob);
|
|
357
|
-
this.recordedChunks = [];
|
|
358
|
-
this.mediaRecorder = null;
|
|
359
|
-
(_a = this.recordingResolve) === null || _a === void 0 ? void 0 : _a.call(this, { webPath: url });
|
|
360
|
-
this.recordingResolve = null;
|
|
361
|
-
this.recordingReject = null;
|
|
362
|
-
};
|
|
363
|
-
this.mediaRecorder.onerror = (event) => {
|
|
364
|
-
var _a, _b, _c;
|
|
365
|
-
if (this.recordingAudioTrack) {
|
|
366
|
-
this.recordingAudioTrack.stop();
|
|
367
|
-
this.recordingAudioTrack = null;
|
|
368
|
-
}
|
|
369
|
-
this.mediaRecorder = null;
|
|
370
|
-
this.recordedChunks = [];
|
|
371
|
-
const errorMessage = (_b = (_a = event.error) === null || _a === void 0 ? void 0 : _a.message) !== null && _b !== void 0 ? _b : 'Unknown recording error';
|
|
372
|
-
(_c = this.recordingReject) === null || _c === void 0 ? void 0 : _c.call(this, new Error('Recording error: ' + errorMessage));
|
|
373
|
-
this.recordingResolve = null;
|
|
374
|
-
this.recordingReject = null;
|
|
375
|
-
};
|
|
376
|
-
this.mediaRecorder.start(100); // Collect data in 100ms chunks
|
|
377
|
-
}
|
|
378
|
-
catch (err) {
|
|
379
|
-
throw new Error(`Failed to start recording: ${this.formatError(err)}`);
|
|
380
|
-
}
|
|
381
|
-
}
|
|
382
|
-
/**
|
|
383
|
-
* Stop the current video recording
|
|
384
|
-
*/
|
|
385
|
-
async stopRecording() {
|
|
386
|
-
if (!this.mediaRecorder) {
|
|
387
|
-
throw new Error('No recording is in progress');
|
|
388
|
-
}
|
|
389
|
-
return new Promise((resolve, reject) => {
|
|
390
|
-
var _a;
|
|
391
|
-
this.recordingResolve = resolve;
|
|
392
|
-
this.recordingReject = reject;
|
|
393
|
-
(_a = this.mediaRecorder) === null || _a === void 0 ? void 0 : _a.stop();
|
|
394
|
-
});
|
|
395
|
-
}
|
|
396
293
|
/**
|
|
397
294
|
* Flip between front and back camera
|
|
398
295
|
*/
|
|
@@ -511,77 +408,45 @@ var capacitorCameraView = (function (exports, core) {
|
|
|
511
408
|
throw this.unimplemented('Torch control is not supported in web implementation.');
|
|
512
409
|
}
|
|
513
410
|
/**
|
|
514
|
-
* Check camera
|
|
411
|
+
* Check camera permission without requesting
|
|
515
412
|
*/
|
|
516
413
|
async checkPermissions() {
|
|
517
414
|
try {
|
|
518
415
|
// Use Permissions API if available
|
|
519
416
|
if (navigator.permissions) {
|
|
520
|
-
const
|
|
521
|
-
navigator.permissions.query({ name: 'camera' }),
|
|
522
|
-
navigator.permissions.query({ name: 'microphone' }),
|
|
523
|
-
]);
|
|
417
|
+
const result = await navigator.permissions.query({ name: 'camera' });
|
|
524
418
|
return {
|
|
525
|
-
camera:
|
|
526
|
-
microphone: microphoneResult.state === 'granted'
|
|
527
|
-
? 'granted'
|
|
528
|
-
: microphoneResult.state === 'denied'
|
|
529
|
-
? 'denied'
|
|
530
|
-
: 'prompt',
|
|
419
|
+
camera: result.state === 'granted' ? 'granted' : result.state === 'denied' ? 'denied' : 'prompt',
|
|
531
420
|
};
|
|
532
421
|
}
|
|
533
|
-
// If Permissions API is not available,
|
|
422
|
+
// If Permissions API is not available, check if we have an active stream
|
|
534
423
|
return {
|
|
535
424
|
camera: this.stream ? 'granted' : 'prompt',
|
|
536
|
-
microphone: 'prompt',
|
|
537
425
|
};
|
|
538
426
|
}
|
|
539
427
|
catch (err) {
|
|
540
428
|
// If permissions API is not supported or fails
|
|
541
429
|
return {
|
|
542
430
|
camera: 'prompt',
|
|
543
|
-
microphone: 'prompt',
|
|
544
431
|
};
|
|
545
432
|
}
|
|
546
433
|
}
|
|
547
434
|
/**
|
|
548
|
-
* Request camera
|
|
549
|
-
* By default, only camera permission is requested.
|
|
435
|
+
* Request camera permission from the user
|
|
550
436
|
*/
|
|
551
|
-
async requestPermissions(
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
stream.getTracks().forEach((track) => track.stop());
|
|
560
|
-
result.camera = 'granted';
|
|
561
|
-
}
|
|
562
|
-
catch (_b) {
|
|
563
|
-
result.camera = 'denied';
|
|
564
|
-
}
|
|
565
|
-
}
|
|
566
|
-
else {
|
|
567
|
-
// Still report current status even if not requesting
|
|
568
|
-
result.camera = (await this.checkPermissions()).camera;
|
|
569
|
-
}
|
|
570
|
-
// Request microphone permission only if explicitly included
|
|
571
|
-
if (permissions.includes('microphone')) {
|
|
572
|
-
try {
|
|
573
|
-
const stream = await navigator.mediaDevices.getUserMedia({ audio: true });
|
|
574
|
-
stream.getTracks().forEach((track) => track.stop());
|
|
575
|
-
result.microphone = 'granted';
|
|
576
|
-
}
|
|
577
|
-
catch (_c) {
|
|
578
|
-
result.microphone = 'denied';
|
|
579
|
-
}
|
|
437
|
+
async requestPermissions() {
|
|
438
|
+
try {
|
|
439
|
+
// Try to access the camera to trigger the permission prompt
|
|
440
|
+
const stream = await navigator.mediaDevices.getUserMedia({ video: true });
|
|
441
|
+
// If we get here, permission was granted
|
|
442
|
+
// Clean up the test stream
|
|
443
|
+
stream.getTracks().forEach((track) => track.stop());
|
|
444
|
+
return { camera: 'granted' };
|
|
580
445
|
}
|
|
581
|
-
|
|
582
|
-
|
|
446
|
+
catch (err) {
|
|
447
|
+
// Permission denied or other error
|
|
448
|
+
return { camera: 'denied' };
|
|
583
449
|
}
|
|
584
|
-
return result;
|
|
585
450
|
}
|
|
586
451
|
/**
|
|
587
452
|
* Start barcode detection if supported
|