@capgo/camera-preview 7.4.0-beta.1 → 7.4.0-beta.2
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 +14 -8
- package/android/src/main/AndroidManifest.xml +5 -0
- package/android/src/main/java/com/ahm/capacitor/camera/preview/CameraPreview.java +35 -20
- package/android/src/main/java/com/ahm/capacitor/camera/preview/CameraXView.java +210 -90
- package/dist/docs.json +27 -2
- package/dist/esm/definitions.d.ts +11 -0
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/web.js +4 -0
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +2 -0
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +2 -0
- package/dist/plugin.js.map +1 -1
- package/ios/Sources/CapgoCameraPreview/Plugin.swift +41 -26
- package/package.json +1 -1
package/dist/plugin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sources":["esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["export var DeviceType;\n(function (DeviceType) {\n DeviceType[\"ULTRA_WIDE\"] = \"ultraWide\";\n DeviceType[\"WIDE_ANGLE\"] = \"wideAngle\";\n DeviceType[\"TELEPHOTO\"] = \"telephoto\";\n DeviceType[\"TRUE_DEPTH\"] = \"trueDepth\";\n DeviceType[\"DUAL\"] = \"dual\";\n DeviceType[\"DUAL_WIDE\"] = \"dualWide\";\n DeviceType[\"TRIPLE\"] = \"triple\";\n})(DeviceType || (DeviceType = {}));\n//# sourceMappingURL=definitions.js.map","import { registerPlugin } from \"@capacitor/core\";\nconst CameraPreview = registerPlugin(\"CameraPreview\", {\n web: () => import(\"./web\").then((m) => new m.CameraPreviewWeb()),\n});\nexport * from \"./definitions\";\nexport { CameraPreview };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from \"@capacitor/core\";\nimport { DeviceType } from \"./definitions\";\nexport class CameraPreviewWeb extends WebPlugin {\n constructor() {\n super();\n /**\n * track which camera is used based on start options\n * used in capture\n */\n this.isBackCamera = false;\n this.currentDeviceId = null;\n }\n async getSupportedPictureSizes() {\n throw new Error(\"getSupportedPictureSizes not supported under the web platform\");\n }\n async start(options) {\n var _a;\n await navigator.mediaDevices\n .getUserMedia({\n audio: !options.disableAudio,\n video: true,\n })\n .then((stream) => {\n // Stop any existing stream so we can request media with different constraints based on user input\n stream.getTracks().forEach((track) => track.stop());\n })\n .catch((error) => {\n Promise.reject(error);\n });\n const video = document.getElementById(\"video\");\n const parent = document.getElementById((options === null || options === void 0 ? void 0 : options.parent) || \"\");\n if (!video) {\n const videoElement = document.createElement(\"video\");\n videoElement.id = \"video\";\n videoElement.setAttribute(\"class\", (options === null || options === void 0 ? void 0 : options.className) || \"\");\n // Don't flip video feed if camera is rear facing\n if (options.position !== \"rear\") {\n videoElement.setAttribute(\"style\", \"-webkit-transform: scaleX(-1); transform: scaleX(-1);\");\n }\n const userAgent = navigator.userAgent.toLowerCase();\n const isSafari = userAgent.includes(\"safari\") && !userAgent.includes(\"chrome\");\n // Safari on iOS needs to have the autoplay, muted and playsinline attributes set for video.play() to be successful\n // Without these attributes videoElement.play() will throw a NotAllowedError\n // https://developer.apple.com/documentation/webkit/delivering_video_content_for_safari\n if (isSafari) {\n videoElement.setAttribute(\"autoplay\", \"true\");\n videoElement.setAttribute(\"muted\", \"true\");\n videoElement.setAttribute(\"playsinline\", \"true\");\n }\n parent === null || parent === void 0 ? void 0 : parent.appendChild(videoElement);\n if ((_a = navigator === null || navigator === void 0 ? void 0 : navigator.mediaDevices) === null || _a === void 0 ? void 0 : _a.getUserMedia) {\n const constraints = {\n video: {\n width: { ideal: options.width },\n height: { ideal: options.height },\n },\n };\n if (options.deviceId) {\n constraints.video.deviceId = { exact: options.deviceId };\n this.currentDeviceId = options.deviceId;\n // Try to determine camera position from device\n const devices = await navigator.mediaDevices.enumerateDevices();\n const device = devices.find(d => d.deviceId === options.deviceId);\n this.isBackCamera = (device === null || device === void 0 ? void 0 : device.label.toLowerCase().includes('back')) || (device === null || device === void 0 ? void 0 : device.label.toLowerCase().includes('rear')) || false;\n }\n else if (options.position === \"rear\") {\n constraints.video.facingMode = \"environment\";\n this.isBackCamera = true;\n }\n else {\n this.isBackCamera = false;\n }\n const self = this;\n await navigator.mediaDevices.getUserMedia(constraints).then((stream) => {\n if (document.getElementById(\"video\")) {\n // video.src = window.URL.createObjectURL(stream);\n videoElement.srcObject = stream;\n videoElement.play();\n Promise.resolve({});\n }\n else {\n self.stopStream(stream);\n Promise.reject(new Error(\"camera already stopped\"));\n }\n }, (err) => {\n Promise.reject(new Error(err));\n });\n }\n }\n else {\n Promise.reject(new Error(\"camera already started\"));\n }\n }\n stopStream(stream) {\n if (stream) {\n const tracks = stream.getTracks();\n for (const track of tracks)\n track.stop();\n }\n }\n async stop() {\n const video = document.getElementById(\"video\");\n if (video) {\n video.pause();\n this.stopStream(video.srcObject);\n video.remove();\n }\n }\n async capture(options) {\n return new Promise((resolve, reject) => {\n const video = document.getElementById(\"video\");\n if (!(video === null || video === void 0 ? void 0 : video.srcObject)) {\n reject(new Error(\"camera is not running\"));\n return;\n }\n // video.width = video.offsetWidth;\n let base64EncodedImage;\n if (video && video.videoWidth > 0 && video.videoHeight > 0) {\n const canvas = document.createElement(\"canvas\");\n const context = canvas.getContext(\"2d\");\n canvas.width = video.videoWidth;\n canvas.height = video.videoHeight;\n // flip horizontally back camera isn't used\n if (!this.isBackCamera) {\n context === null || context === void 0 ? void 0 : context.translate(video.videoWidth, 0);\n context === null || context === void 0 ? void 0 : context.scale(-1, 1);\n }\n context === null || context === void 0 ? void 0 : context.drawImage(video, 0, 0, video.videoWidth, video.videoHeight);\n if ((options.format || \"jpeg\") === \"jpeg\") {\n base64EncodedImage = canvas\n .toDataURL(\"image/jpeg\", (options.quality || 85) / 100.0)\n .replace(\"data:image/jpeg;base64,\", \"\");\n }\n else {\n base64EncodedImage = canvas\n .toDataURL(\"image/png\")\n .replace(\"data:image/png;base64,\", \"\");\n }\n }\n resolve({\n value: base64EncodedImage,\n });\n });\n }\n async captureSample(_options) {\n return this.capture(_options);\n }\n async stopRecordVideo() {\n throw new Error(\"stopRecordVideo not supported under the web platform\");\n }\n async startRecordVideo(_options) {\n console.log(\"startRecordVideo\", _options);\n throw new Error(\"startRecordVideo not supported under the web platform\");\n }\n async getSupportedFlashModes() {\n throw new Error(\"getSupportedFlashModes not supported under the web platform\");\n }\n async getHorizontalFov() {\n throw new Error(\"getHorizontalFov not supported under the web platform\");\n }\n async setFlashMode(_options) {\n throw new Error(`setFlashMode not supported under the web platform${_options}`);\n }\n async flip() {\n const video = document.getElementById(\"video\");\n if (!(video === null || video === void 0 ? void 0 : video.srcObject)) {\n throw new Error(\"camera is not running\");\n }\n // Stop current stream\n this.stopStream(video.srcObject);\n // Toggle camera position\n this.isBackCamera = !this.isBackCamera;\n // Get new constraints\n const constraints = {\n video: {\n facingMode: this.isBackCamera ? \"environment\" : \"user\",\n width: { ideal: video.videoWidth || 640 },\n height: { ideal: video.videoHeight || 480 },\n },\n };\n try {\n const stream = await navigator.mediaDevices.getUserMedia(constraints);\n video.srcObject = stream;\n // Update current device ID from the new stream\n const videoTrack = stream.getVideoTracks()[0];\n if (videoTrack) {\n this.currentDeviceId = videoTrack.getSettings().deviceId || null;\n }\n // Update video transform based on camera\n if (this.isBackCamera) {\n video.style.transform = \"none\";\n video.style.webkitTransform = \"none\";\n }\n else {\n video.style.transform = \"scaleX(-1)\";\n video.style.webkitTransform = \"scaleX(-1)\";\n }\n await video.play();\n }\n catch (error) {\n throw new Error(`Failed to flip camera: ${error}`);\n }\n }\n async setOpacity(_options) {\n const video = document.getElementById(\"video\");\n if (!!video && !!_options.opacity)\n video.style.setProperty(\"opacity\", _options.opacity.toString());\n }\n async isRunning() {\n const video = document.getElementById(\"video\");\n return { isRunning: !!video && !!video.srcObject };\n }\n async getAvailableDevices() {\n var _a;\n if (!((_a = navigator.mediaDevices) === null || _a === void 0 ? void 0 : _a.enumerateDevices)) {\n throw new Error(\"getAvailableDevices not supported under the web platform\");\n }\n const devices = await navigator.mediaDevices.enumerateDevices();\n const videoDevices = devices.filter(device => device.kind === 'videoinput');\n // Group devices by position (front/back)\n const frontDevices = [];\n const backDevices = [];\n videoDevices.forEach((device, index) => {\n const label = device.label || `Camera ${index + 1}`;\n const labelLower = label.toLowerCase();\n // Determine device type based on label\n let deviceType = DeviceType.WIDE_ANGLE;\n let baseZoomRatio = 1.0;\n if (labelLower.includes('ultra') || labelLower.includes('0.5')) {\n deviceType = DeviceType.ULTRA_WIDE;\n baseZoomRatio = 0.5;\n }\n else if (labelLower.includes('telephoto') || labelLower.includes('tele') || labelLower.includes('2x') || labelLower.includes('3x')) {\n deviceType = DeviceType.TELEPHOTO;\n baseZoomRatio = 2.0;\n }\n else if (labelLower.includes('depth') || labelLower.includes('truedepth')) {\n deviceType = DeviceType.TRUE_DEPTH;\n baseZoomRatio = 1.0;\n }\n const lensInfo = {\n deviceId: device.deviceId,\n label,\n deviceType,\n focalLength: 4.25,\n baseZoomRatio,\n minZoom: 1.0,\n maxZoom: 1.0\n };\n // Determine position and add to appropriate array\n if (labelLower.includes('back') || labelLower.includes('rear')) {\n backDevices.push(lensInfo);\n }\n else {\n frontDevices.push(lensInfo);\n }\n });\n const result = [];\n if (frontDevices.length > 0) {\n result.push({\n deviceId: frontDevices[0].deviceId,\n label: \"Front Camera\",\n position: \"front\",\n lenses: frontDevices,\n isLogical: false,\n minZoom: Math.min(...frontDevices.map(d => d.minZoom)),\n maxZoom: Math.max(...frontDevices.map(d => d.maxZoom))\n });\n }\n if (backDevices.length > 0) {\n result.push({\n deviceId: backDevices[0].deviceId,\n label: \"Back Camera\",\n position: \"rear\",\n lenses: backDevices,\n isLogical: false,\n minZoom: Math.min(...backDevices.map(d => d.minZoom)),\n maxZoom: Math.max(...backDevices.map(d => d.maxZoom))\n });\n }\n return { devices: result };\n }\n async getZoom() {\n const video = document.getElementById(\"video\");\n if (!(video === null || video === void 0 ? void 0 : video.srcObject)) {\n throw new Error(\"camera is not running\");\n }\n const stream = video.srcObject;\n const videoTrack = stream.getVideoTracks()[0];\n if (!videoTrack) {\n throw new Error(\"no video track found\");\n }\n const capabilities = videoTrack.getCapabilities();\n const settings = videoTrack.getSettings();\n if (!capabilities.zoom) {\n throw new Error(\"zoom not supported by this device\");\n }\n // Get current device info to determine lens type\n let deviceType = DeviceType.WIDE_ANGLE;\n let baseZoomRatio = 1.0;\n if (this.currentDeviceId) {\n const devices = await navigator.mediaDevices.enumerateDevices();\n const device = devices.find(d => d.deviceId === this.currentDeviceId);\n if (device) {\n const labelLower = device.label.toLowerCase();\n if (labelLower.includes('ultra') || labelLower.includes('0.5')) {\n deviceType = DeviceType.ULTRA_WIDE;\n baseZoomRatio = 0.5;\n }\n else if (labelLower.includes('telephoto') || labelLower.includes('tele') || labelLower.includes('2x') || labelLower.includes('3x')) {\n deviceType = DeviceType.TELEPHOTO;\n baseZoomRatio = 2.0;\n }\n else if (labelLower.includes('depth') || labelLower.includes('truedepth')) {\n deviceType = DeviceType.TRUE_DEPTH;\n baseZoomRatio = 1.0;\n }\n }\n }\n const currentZoom = settings.zoom || 1;\n const lensInfo = {\n focalLength: 4.25,\n deviceType,\n baseZoomRatio,\n digitalZoom: currentZoom / baseZoomRatio\n };\n return {\n min: capabilities.zoom.min || 1,\n max: capabilities.zoom.max || 1,\n current: currentZoom,\n lens: lensInfo,\n };\n }\n async setZoom(options) {\n const video = document.getElementById(\"video\");\n if (!(video === null || video === void 0 ? void 0 : video.srcObject)) {\n throw new Error(\"camera is not running\");\n }\n const stream = video.srcObject;\n const videoTrack = stream.getVideoTracks()[0];\n if (!videoTrack) {\n throw new Error(\"no video track found\");\n }\n const capabilities = videoTrack.getCapabilities();\n if (!capabilities.zoom) {\n throw new Error(\"zoom not supported by this device\");\n }\n const zoomLevel = Math.max(capabilities.zoom.min || 1, Math.min(capabilities.zoom.max || 1, options.level));\n try {\n await videoTrack.applyConstraints({\n advanced: [{ zoom: zoomLevel }]\n });\n }\n catch (error) {\n throw new Error(`Failed to set zoom: ${error}`);\n }\n }\n async getFlashMode() {\n throw new Error(\"getFlashMode not supported under the web platform\");\n }\n async getDeviceId() {\n return { deviceId: this.currentDeviceId || \"\" };\n }\n async setDeviceId(options) {\n const video = document.getElementById(\"video\");\n if (!(video === null || video === void 0 ? void 0 : video.srcObject)) {\n throw new Error(\"camera is not running\");\n }\n // Stop current stream\n this.stopStream(video.srcObject);\n // Update current device ID\n this.currentDeviceId = options.deviceId;\n // Get new constraints with specific device ID\n const constraints = {\n video: {\n deviceId: { exact: options.deviceId },\n width: { ideal: video.videoWidth || 640 },\n height: { ideal: video.videoHeight || 480 },\n },\n };\n try {\n // Try to determine camera position from device\n const devices = await navigator.mediaDevices.enumerateDevices();\n const device = devices.find(d => d.deviceId === options.deviceId);\n this.isBackCamera = (device === null || device === void 0 ? void 0 : device.label.toLowerCase().includes('back')) || (device === null || device === void 0 ? void 0 : device.label.toLowerCase().includes('rear')) || false;\n const stream = await navigator.mediaDevices.getUserMedia(constraints);\n video.srcObject = stream;\n // Update video transform based on camera\n if (this.isBackCamera) {\n video.style.transform = \"none\";\n video.style.webkitTransform = \"none\";\n }\n else {\n video.style.transform = \"scaleX(-1)\";\n video.style.webkitTransform = \"scaleX(-1)\";\n }\n await video.play();\n }\n catch (error) {\n throw new Error(`Failed to swap to device ${options.deviceId}: ${error}`);\n }\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["DeviceType","registerPlugin","WebPlugin"],"mappings":";;;AAAWA;IACX,CAAC,UAAU,UAAU,EAAE;IACvB,IAAI,UAAU,CAAC,YAAY,CAAC,GAAG,WAAW;IAC1C,IAAI,UAAU,CAAC,YAAY,CAAC,GAAG,WAAW;IAC1C,IAAI,UAAU,CAAC,WAAW,CAAC,GAAG,WAAW;IACzC,IAAI,UAAU,CAAC,YAAY,CAAC,GAAG,WAAW;IAC1C,IAAI,UAAU,CAAC,MAAM,CAAC,GAAG,MAAM;IAC/B,IAAI,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CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,MAAM,KAAK,IAAI,IAAI,MAAM,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,IAAI,KAAK;IACvO,YAAY,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,YAAY,CAAC,YAAY,CAAC,WAAW,CAAC;IACjF,YAAY,KAAK,CAAC,SAAS,GAAG,MAAM;IACpC;IACA,YAAY,IAAI,IAAI,CAAC,YAAY,EAAE;IACnC,gBAAgB,KAAK,CAAC,KAAK,CAAC,SAAS,GAAG,MAAM;IAC9C,gBAAgB,KAAK,CAAC,KAAK,CAAC,eAAe,GAAG,MAAM;IACpD;IACA,iBAAiB;IACjB,gBAAgB,KAAK,CAAC,KAAK,CAAC,SAAS,GAAG,YAAY;IACpD,gBAAgB,KAAK,CAAC,KAAK,CAAC,eAAe,GAAG,YAAY;IAC1D;IACA,YAAY,MAAM,KAAK,CAAC,IAAI,EAAE;IAC9B;IACA,QAAQ,OAAO,KAAK,EAAE;IACtB,YAAY,MAAM,IAAI,KAAK,CAAC,CAAC,yBAAyB,EAAE,OAAO,CAAC,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC,CAAC;IACrF;IACA;IACA;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"plugin.js","sources":["esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["export var DeviceType;\n(function (DeviceType) {\n DeviceType[\"ULTRA_WIDE\"] = \"ultraWide\";\n DeviceType[\"WIDE_ANGLE\"] = \"wideAngle\";\n DeviceType[\"TELEPHOTO\"] = \"telephoto\";\n DeviceType[\"TRUE_DEPTH\"] = \"trueDepth\";\n DeviceType[\"DUAL\"] = \"dual\";\n DeviceType[\"DUAL_WIDE\"] = \"dualWide\";\n DeviceType[\"TRIPLE\"] = \"triple\";\n})(DeviceType || (DeviceType = {}));\n//# sourceMappingURL=definitions.js.map","import { registerPlugin } from \"@capacitor/core\";\nconst CameraPreview = registerPlugin(\"CameraPreview\", {\n web: () => import(\"./web\").then((m) => new m.CameraPreviewWeb()),\n});\nexport * from \"./definitions\";\nexport { CameraPreview };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from \"@capacitor/core\";\nimport { DeviceType } from \"./definitions\";\nexport class CameraPreviewWeb extends WebPlugin {\n constructor() {\n super();\n /**\n * track which camera is used based on start options\n * used in capture\n */\n this.isBackCamera = false;\n this.currentDeviceId = null;\n }\n async getSupportedPictureSizes() {\n throw new Error(\"getSupportedPictureSizes not supported under the web platform\");\n }\n async start(options) {\n var _a;\n await navigator.mediaDevices\n .getUserMedia({\n audio: !options.disableAudio,\n video: true,\n })\n .then((stream) => {\n // Stop any existing stream so we can request media with different constraints based on user input\n stream.getTracks().forEach((track) => track.stop());\n })\n .catch((error) => {\n Promise.reject(error);\n });\n const video = document.getElementById(\"video\");\n const parent = document.getElementById((options === null || options === void 0 ? void 0 : options.parent) || \"\");\n if (!video) {\n const videoElement = document.createElement(\"video\");\n videoElement.id = \"video\";\n videoElement.setAttribute(\"class\", (options === null || options === void 0 ? void 0 : options.className) || \"\");\n // Don't flip video feed if camera is rear facing\n if (options.position !== \"rear\") {\n videoElement.setAttribute(\"style\", \"-webkit-transform: scaleX(-1); transform: scaleX(-1);\");\n }\n const userAgent = navigator.userAgent.toLowerCase();\n const isSafari = userAgent.includes(\"safari\") && !userAgent.includes(\"chrome\");\n // Safari on iOS needs to have the autoplay, muted and playsinline attributes set for video.play() to be successful\n // Without these attributes videoElement.play() will throw a NotAllowedError\n // https://developer.apple.com/documentation/webkit/delivering_video_content_for_safari\n if (isSafari) {\n videoElement.setAttribute(\"autoplay\", \"true\");\n videoElement.setAttribute(\"muted\", \"true\");\n videoElement.setAttribute(\"playsinline\", \"true\");\n }\n parent === null || parent === void 0 ? void 0 : parent.appendChild(videoElement);\n if ((_a = navigator === null || navigator === void 0 ? void 0 : navigator.mediaDevices) === null || _a === void 0 ? void 0 : _a.getUserMedia) {\n const constraints = {\n video: {\n width: { ideal: options.width },\n height: { ideal: options.height },\n },\n };\n if (options.deviceId) {\n constraints.video.deviceId = { exact: options.deviceId };\n this.currentDeviceId = options.deviceId;\n // Try to determine camera position from device\n const devices = await navigator.mediaDevices.enumerateDevices();\n const device = devices.find(d => d.deviceId === options.deviceId);\n this.isBackCamera = (device === null || device === void 0 ? void 0 : device.label.toLowerCase().includes('back')) || (device === null || device === void 0 ? void 0 : device.label.toLowerCase().includes('rear')) || false;\n }\n else if (options.position === \"rear\") {\n constraints.video.facingMode = \"environment\";\n this.isBackCamera = true;\n }\n else {\n this.isBackCamera = false;\n }\n const self = this;\n await navigator.mediaDevices.getUserMedia(constraints).then((stream) => {\n if (document.getElementById(\"video\")) {\n // video.src = window.URL.createObjectURL(stream);\n videoElement.srcObject = stream;\n videoElement.play();\n Promise.resolve({});\n }\n else {\n self.stopStream(stream);\n Promise.reject(new Error(\"camera already stopped\"));\n }\n }, (err) => {\n Promise.reject(new Error(err));\n });\n }\n }\n else {\n Promise.reject(new Error(\"camera already started\"));\n }\n }\n stopStream(stream) {\n if (stream) {\n const tracks = stream.getTracks();\n for (const track of tracks)\n track.stop();\n }\n }\n async stop() {\n const video = document.getElementById(\"video\");\n if (video) {\n video.pause();\n this.stopStream(video.srcObject);\n video.remove();\n }\n }\n async capture(options) {\n return new Promise((resolve, reject) => {\n const video = document.getElementById(\"video\");\n if (!(video === null || video === void 0 ? void 0 : video.srcObject)) {\n reject(new Error(\"camera is not running\"));\n return;\n }\n // video.width = video.offsetWidth;\n let base64EncodedImage;\n if (video && video.videoWidth > 0 && video.videoHeight > 0) {\n const canvas = document.createElement(\"canvas\");\n const context = canvas.getContext(\"2d\");\n canvas.width = video.videoWidth;\n canvas.height = video.videoHeight;\n // flip horizontally back camera isn't used\n if (!this.isBackCamera) {\n context === null || context === void 0 ? void 0 : context.translate(video.videoWidth, 0);\n context === null || context === void 0 ? void 0 : context.scale(-1, 1);\n }\n context === null || context === void 0 ? void 0 : context.drawImage(video, 0, 0, video.videoWidth, video.videoHeight);\n if (options.saveToGallery) {\n // saveToGallery is not supported on web\n }\n if ((options.format || \"jpeg\") === \"jpeg\") {\n base64EncodedImage = canvas\n .toDataURL(\"image/jpeg\", (options.quality || 85) / 100.0)\n .replace(\"data:image/jpeg;base64,\", \"\");\n }\n else {\n base64EncodedImage = canvas\n .toDataURL(\"image/png\")\n .replace(\"data:image/png;base64,\", \"\");\n }\n }\n resolve({\n value: base64EncodedImage,\n exif: {},\n });\n });\n }\n async captureSample(_options) {\n return this.capture(_options);\n }\n async stopRecordVideo() {\n throw new Error(\"stopRecordVideo not supported under the web platform\");\n }\n async startRecordVideo(_options) {\n console.log(\"startRecordVideo\", _options);\n throw new Error(\"startRecordVideo not supported under the web platform\");\n }\n async getSupportedFlashModes() {\n throw new Error(\"getSupportedFlashModes not supported under the web platform\");\n }\n async getHorizontalFov() {\n throw new Error(\"getHorizontalFov not supported under the web platform\");\n }\n async setFlashMode(_options) {\n throw new Error(`setFlashMode not supported under the web platform${_options}`);\n }\n async flip() {\n const video = document.getElementById(\"video\");\n if (!(video === null || video === void 0 ? void 0 : video.srcObject)) {\n throw new Error(\"camera is not running\");\n }\n // Stop current stream\n this.stopStream(video.srcObject);\n // Toggle camera position\n this.isBackCamera = !this.isBackCamera;\n // Get new constraints\n const constraints = {\n video: {\n facingMode: this.isBackCamera ? \"environment\" : \"user\",\n width: { ideal: video.videoWidth || 640 },\n height: { ideal: video.videoHeight || 480 },\n },\n };\n try {\n const stream = await navigator.mediaDevices.getUserMedia(constraints);\n video.srcObject = stream;\n // Update current device ID from the new stream\n const videoTrack = stream.getVideoTracks()[0];\n if (videoTrack) {\n this.currentDeviceId = videoTrack.getSettings().deviceId || null;\n }\n // Update video transform based on camera\n if (this.isBackCamera) {\n video.style.transform = \"none\";\n video.style.webkitTransform = \"none\";\n }\n else {\n video.style.transform = \"scaleX(-1)\";\n video.style.webkitTransform = \"scaleX(-1)\";\n }\n await video.play();\n }\n catch (error) {\n throw new Error(`Failed to flip camera: ${error}`);\n }\n }\n async setOpacity(_options) {\n const video = document.getElementById(\"video\");\n if (!!video && !!_options.opacity)\n video.style.setProperty(\"opacity\", _options.opacity.toString());\n }\n async isRunning() {\n const video = document.getElementById(\"video\");\n return { isRunning: !!video && !!video.srcObject };\n }\n async getAvailableDevices() {\n var _a;\n if (!((_a = navigator.mediaDevices) === null || _a === void 0 ? void 0 : _a.enumerateDevices)) {\n throw new Error(\"getAvailableDevices not supported under the web platform\");\n }\n const devices = await navigator.mediaDevices.enumerateDevices();\n const videoDevices = devices.filter(device => device.kind === 'videoinput');\n // Group devices by position (front/back)\n const frontDevices = [];\n const backDevices = [];\n videoDevices.forEach((device, index) => {\n const label = device.label || `Camera ${index + 1}`;\n const labelLower = label.toLowerCase();\n // Determine device type based on label\n let deviceType = DeviceType.WIDE_ANGLE;\n let baseZoomRatio = 1.0;\n if (labelLower.includes('ultra') || labelLower.includes('0.5')) {\n deviceType = DeviceType.ULTRA_WIDE;\n baseZoomRatio = 0.5;\n }\n else if (labelLower.includes('telephoto') || labelLower.includes('tele') || labelLower.includes('2x') || labelLower.includes('3x')) {\n deviceType = DeviceType.TELEPHOTO;\n baseZoomRatio = 2.0;\n }\n else if (labelLower.includes('depth') || labelLower.includes('truedepth')) {\n deviceType = DeviceType.TRUE_DEPTH;\n baseZoomRatio = 1.0;\n }\n const lensInfo = {\n deviceId: device.deviceId,\n label,\n deviceType,\n focalLength: 4.25,\n baseZoomRatio,\n minZoom: 1.0,\n maxZoom: 1.0\n };\n // Determine position and add to appropriate array\n if (labelLower.includes('back') || labelLower.includes('rear')) {\n backDevices.push(lensInfo);\n }\n else {\n frontDevices.push(lensInfo);\n }\n });\n const result = [];\n if (frontDevices.length > 0) {\n result.push({\n deviceId: frontDevices[0].deviceId,\n label: \"Front Camera\",\n position: \"front\",\n lenses: frontDevices,\n isLogical: false,\n minZoom: Math.min(...frontDevices.map(d => d.minZoom)),\n maxZoom: Math.max(...frontDevices.map(d => d.maxZoom))\n });\n }\n if (backDevices.length > 0) {\n result.push({\n deviceId: backDevices[0].deviceId,\n label: \"Back Camera\",\n position: \"rear\",\n lenses: backDevices,\n isLogical: false,\n minZoom: Math.min(...backDevices.map(d => d.minZoom)),\n maxZoom: Math.max(...backDevices.map(d => d.maxZoom))\n });\n }\n return { devices: result };\n }\n async getZoom() {\n const video = document.getElementById(\"video\");\n if (!(video === null || video === void 0 ? void 0 : video.srcObject)) {\n throw new Error(\"camera is not running\");\n }\n const stream = video.srcObject;\n const videoTrack = stream.getVideoTracks()[0];\n if (!videoTrack) {\n throw new Error(\"no video track found\");\n }\n const capabilities = videoTrack.getCapabilities();\n const settings = videoTrack.getSettings();\n if (!capabilities.zoom) {\n throw new Error(\"zoom not supported by this device\");\n }\n // Get current device info to determine lens type\n let deviceType = DeviceType.WIDE_ANGLE;\n let baseZoomRatio = 1.0;\n if (this.currentDeviceId) {\n const devices = await navigator.mediaDevices.enumerateDevices();\n const device = devices.find(d => d.deviceId === this.currentDeviceId);\n if (device) {\n const labelLower = device.label.toLowerCase();\n if (labelLower.includes('ultra') || labelLower.includes('0.5')) {\n deviceType = DeviceType.ULTRA_WIDE;\n baseZoomRatio = 0.5;\n }\n else if (labelLower.includes('telephoto') || labelLower.includes('tele') || labelLower.includes('2x') || labelLower.includes('3x')) {\n deviceType = DeviceType.TELEPHOTO;\n baseZoomRatio = 2.0;\n }\n else if (labelLower.includes('depth') || labelLower.includes('truedepth')) {\n deviceType = DeviceType.TRUE_DEPTH;\n baseZoomRatio = 1.0;\n }\n }\n }\n const currentZoom = settings.zoom || 1;\n const lensInfo = {\n focalLength: 4.25,\n deviceType,\n baseZoomRatio,\n digitalZoom: currentZoom / baseZoomRatio\n };\n return {\n min: capabilities.zoom.min || 1,\n max: capabilities.zoom.max || 1,\n current: currentZoom,\n lens: lensInfo,\n };\n }\n async setZoom(options) {\n const video = document.getElementById(\"video\");\n if (!(video === null || video === void 0 ? void 0 : video.srcObject)) {\n throw new Error(\"camera is not running\");\n }\n const stream = video.srcObject;\n const videoTrack = stream.getVideoTracks()[0];\n if (!videoTrack) {\n throw new Error(\"no video track found\");\n }\n const capabilities = videoTrack.getCapabilities();\n if (!capabilities.zoom) {\n throw new Error(\"zoom not supported by this device\");\n }\n const zoomLevel = Math.max(capabilities.zoom.min || 1, Math.min(capabilities.zoom.max || 1, options.level));\n try {\n await videoTrack.applyConstraints({\n advanced: [{ zoom: zoomLevel }]\n });\n }\n catch (error) {\n throw new Error(`Failed to set zoom: ${error}`);\n }\n }\n async getFlashMode() {\n throw new Error(\"getFlashMode not supported under the web platform\");\n }\n async getDeviceId() {\n return { deviceId: this.currentDeviceId || \"\" };\n }\n async setDeviceId(options) {\n const video = document.getElementById(\"video\");\n if (!(video === null || video === void 0 ? void 0 : video.srcObject)) {\n throw new Error(\"camera is not running\");\n }\n // Stop current stream\n this.stopStream(video.srcObject);\n // Update current device ID\n this.currentDeviceId = options.deviceId;\n // Get new constraints with specific device ID\n const constraints = {\n video: {\n deviceId: { exact: options.deviceId },\n width: { ideal: video.videoWidth || 640 },\n height: { ideal: video.videoHeight || 480 },\n },\n };\n try {\n // Try to determine camera position from device\n const devices = await navigator.mediaDevices.enumerateDevices();\n const device = devices.find(d => d.deviceId === options.deviceId);\n this.isBackCamera = (device === null || device === void 0 ? void 0 : device.label.toLowerCase().includes('back')) || (device === null || device === void 0 ? void 0 : device.label.toLowerCase().includes('rear')) || false;\n const stream = await navigator.mediaDevices.getUserMedia(constraints);\n video.srcObject = stream;\n // Update video transform based on camera\n if (this.isBackCamera) {\n video.style.transform = \"none\";\n video.style.webkitTransform = \"none\";\n }\n else {\n video.style.transform = \"scaleX(-1)\";\n video.style.webkitTransform = \"scaleX(-1)\";\n }\n await video.play();\n }\n catch (error) {\n throw new Error(`Failed to swap to device ${options.deviceId}: ${error}`);\n }\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["DeviceType","register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;;;;;;;;;;;;;"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import Foundation
|
|
2
2
|
import Capacitor
|
|
3
3
|
import AVFoundation
|
|
4
|
+
import Photos
|
|
5
|
+
import CoreImage
|
|
4
6
|
|
|
5
7
|
extension UIWindow {
|
|
6
8
|
static var isLandscape: Bool {
|
|
@@ -436,43 +438,56 @@ public class CameraPreview: CAPPlugin, CAPBridgedPlugin {
|
|
|
436
438
|
@objc func capture(_ call: CAPPluginCall) {
|
|
437
439
|
DispatchQueue.main.async {
|
|
438
440
|
|
|
439
|
-
let quality
|
|
440
|
-
|
|
441
|
-
self.cameraController.captureImage { (image, error) in
|
|
441
|
+
let quality = call.getFloat("quality", 85)
|
|
442
|
+
let saveToGallery = call.getBool("saveToGallery", false)
|
|
442
443
|
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
guard let error = error else {
|
|
446
|
-
call.reject("Image capture error")
|
|
447
|
-
return
|
|
448
|
-
}
|
|
444
|
+
self.cameraController.captureImage(quality: quality) { (image, error) in
|
|
445
|
+
if let error = error {
|
|
449
446
|
call.reject(error.localizedDescription)
|
|
450
447
|
return
|
|
451
448
|
}
|
|
452
|
-
|
|
453
|
-
if
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
449
|
+
|
|
450
|
+
if saveToGallery {
|
|
451
|
+
PHPhotoLibrary.shared().performChanges({
|
|
452
|
+
PHAssetChangeRequest.creationRequestForAsset(from: image!)
|
|
453
|
+
}, completionHandler: { (success, error) in
|
|
454
|
+
if !success {
|
|
455
|
+
Logger.error("CameraPreview", "Error saving image to gallery", error)
|
|
456
|
+
}
|
|
457
|
+
})
|
|
458
458
|
}
|
|
459
459
|
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
} else {
|
|
464
|
-
do {
|
|
465
|
-
let fileUrl=self.getTempFilePath()
|
|
466
|
-
try imageData?.write(to: fileUrl)
|
|
467
|
-
call.resolve(["value": fileUrl.absoluteString])
|
|
468
|
-
} catch {
|
|
469
|
-
call.reject("error writing image to file")
|
|
470
|
-
}
|
|
460
|
+
guard let imageData = image?.jpegData(compressionQuality: CGFloat(quality / 100.0)) else {
|
|
461
|
+
call.reject("Failed to get JPEG data from image")
|
|
462
|
+
return
|
|
471
463
|
}
|
|
464
|
+
|
|
465
|
+
let exifData = self.getExifData(from: imageData)
|
|
466
|
+
let base64Image = imageData.base64EncodedString()
|
|
467
|
+
|
|
468
|
+
var result = JSObject()
|
|
469
|
+
result["value"] = base64Image
|
|
470
|
+
result["exif"] = exifData
|
|
471
|
+
call.resolve(result)
|
|
472
472
|
}
|
|
473
473
|
}
|
|
474
474
|
}
|
|
475
475
|
|
|
476
|
+
private func getExifData(from imageData: Data) -> JSObject {
|
|
477
|
+
guard let imageSource = CGImageSourceCreateWithData(imageData as CFData, nil),
|
|
478
|
+
let imageProperties = CGImageSourceCopyPropertiesAtIndex(imageSource, 0, nil) as? [String: Any],
|
|
479
|
+
let exifDict = imageProperties[kCGImagePropertyExifDictionary as String] as? [String: Any] else {
|
|
480
|
+
return [:]
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
var exifData = JSObject()
|
|
484
|
+
for (key, value) in exifDict {
|
|
485
|
+
exifData[key] = value
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
return exifData
|
|
489
|
+
}
|
|
490
|
+
|
|
476
491
|
@objc func captureSample(_ call: CAPPluginCall) {
|
|
477
492
|
DispatchQueue.main.async {
|
|
478
493
|
let quality: Int? = call.getInt("quality", 85)
|