@carviz/capacitor-camera-preview 7.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/CarvizCapacitorCameraPreview.podspec +17 -0
  2. package/LICENSE +22 -0
  3. package/README.md +229 -0
  4. package/android/.project +17 -0
  5. package/android/build.gradle +57 -0
  6. package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  7. package/android/gradle/wrapper/gradle-wrapper.properties +8 -0
  8. package/android/gradle.properties +18 -0
  9. package/android/gradlew +248 -0
  10. package/android/gradlew.bat +92 -0
  11. package/android/proguard-rules.pro +21 -0
  12. package/android/settings.gradle +2 -0
  13. package/android/src/androidTest/java/com/getcapacitor/android/ExampleInstrumentedTest.java +26 -0
  14. package/android/src/main/AndroidManifest.xml +5 -0
  15. package/android/src/main/java/com/ahm/capacitor/camera/preview/CameraActivity.java +831 -0
  16. package/android/src/main/java/com/ahm/capacitor/camera/preview/CameraPreview.java +396 -0
  17. package/android/src/main/java/com/ahm/capacitor/camera/preview/CustomSurfaceView.java +23 -0
  18. package/android/src/main/java/com/ahm/capacitor/camera/preview/CustomTextureView.java +29 -0
  19. package/android/src/main/java/com/ahm/capacitor/camera/preview/Preview.java +384 -0
  20. package/android/src/main/java/com/ahm/capacitor/camera/preview/TapGestureDetector.java +24 -0
  21. package/android/src/main/res/layout/bridge_layout_main.xml +15 -0
  22. package/android/src/main/res/layout/camera_activity.xml +68 -0
  23. package/android/src/main/res/values/camera_ids.xml +4 -0
  24. package/android/src/main/res/values/camera_theme.xml +9 -0
  25. package/android/src/main/res/values/colors.xml +3 -0
  26. package/android/src/main/res/values/strings.xml +3 -0
  27. package/android/src/main/res/values/styles.xml +3 -0
  28. package/android/src/test/java/com/getcapacitor/ExampleUnitTest.java +18 -0
  29. package/dist/esm/definitions.d.ts +86 -0
  30. package/dist/esm/definitions.js +2 -0
  31. package/dist/esm/definitions.js.map +1 -0
  32. package/dist/esm/index.d.ts +4 -0
  33. package/dist/esm/index.js +7 -0
  34. package/dist/esm/index.js.map +1 -0
  35. package/dist/esm/web.d.ts +24 -0
  36. package/dist/esm/web.js +120 -0
  37. package/dist/esm/web.js.map +1 -0
  38. package/dist/plugin.cjs.js +134 -0
  39. package/dist/plugin.cjs.js.map +1 -0
  40. package/dist/plugin.js +137 -0
  41. package/dist/plugin.js.map +1 -0
  42. package/ios/Plugin/CameraController.swift +483 -0
  43. package/ios/Plugin/Info.plist +24 -0
  44. package/ios/Plugin/Plugin.h +10 -0
  45. package/ios/Plugin/Plugin.m +16 -0
  46. package/ios/Plugin/Plugin.swift +324 -0
  47. package/ios/Plugin/UIImage.swift +56 -0
  48. package/ios/Plugin.xcodeproj/project.pbxproj +599 -0
  49. package/ios/Plugin.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
  50. package/ios/Plugin.xcworkspace/contents.xcworkspacedata +10 -0
  51. package/ios/Plugin.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  52. package/ios/PluginTests/Info.plist +22 -0
  53. package/ios/PluginTests/PluginTests.swift +16 -0
  54. package/ios/Podfile +16 -0
  55. package/ios/Podfile.lock +22 -0
  56. package/package.json +85 -0
@@ -0,0 +1,120 @@
1
+ import { WebPlugin } from '@capacitor/core';
2
+ export class CameraPreviewWeb extends WebPlugin {
3
+ constructor() {
4
+ super();
5
+ }
6
+ async start(options) {
7
+ var _a;
8
+ const stream = await navigator.mediaDevices.getUserMedia({ video: true });
9
+ // Stop any existing stream so we can request media with different constraints based on user input
10
+ stream.getTracks().forEach((track) => track.stop());
11
+ const video = document.getElementById('video');
12
+ const parent = document.getElementById(options.parent);
13
+ if (video) {
14
+ throw new Error('camera already started');
15
+ }
16
+ const videoElement = document.createElement('video');
17
+ videoElement.id = 'video';
18
+ videoElement.setAttribute('class', options.className || '');
19
+ // Don't flip video feed if camera is rear facing
20
+ if (options.position !== 'rear') {
21
+ videoElement.setAttribute('style', '-webkit-transform: scaleX(-1); transform: scaleX(-1);');
22
+ }
23
+ const userAgent = navigator.userAgent.toLowerCase();
24
+ const isSafari = userAgent.includes('safari') && !userAgent.includes('chrome');
25
+ // Safari on iOS needs to have the autoplay, muted and playsinline attributes set for video.play() to be successful
26
+ // Without these attributes videoElement.play() will throw a NotAllowedError
27
+ // https://developer.apple.com/documentation/webkit/delivering_video_content_for_safari
28
+ if (isSafari) {
29
+ videoElement.setAttribute('autoplay', 'true');
30
+ videoElement.setAttribute('muted', 'true');
31
+ videoElement.setAttribute('playsinline', 'true');
32
+ }
33
+ parent.appendChild(videoElement);
34
+ if (!((_a = navigator.mediaDevices) === null || _a === void 0 ? void 0 : _a.getUserMedia)) {
35
+ throw new Error('No media devices available');
36
+ }
37
+ const constraints = {
38
+ video: {
39
+ width: { ideal: options.width },
40
+ height: { ideal: options.height },
41
+ },
42
+ };
43
+ if (options.position === 'rear') {
44
+ constraints.video.facingMode = 'environment';
45
+ this.isBackCamera = true;
46
+ }
47
+ else {
48
+ this.isBackCamera = false;
49
+ }
50
+ videoElement.srcObject = await navigator.mediaDevices.getUserMedia(constraints);
51
+ videoElement.play();
52
+ return {};
53
+ }
54
+ async stop() {
55
+ const video = document.getElementById('video');
56
+ if (video) {
57
+ video.pause();
58
+ const st = video.srcObject;
59
+ const tracks = st.getTracks();
60
+ for (let i = 0; i < tracks.length; i++) {
61
+ const track = tracks[i];
62
+ track.stop();
63
+ }
64
+ video.remove();
65
+ }
66
+ }
67
+ async capture(options) {
68
+ return new Promise((resolve, _) => {
69
+ const video = document.getElementById('video');
70
+ const canvas = document.createElement('canvas');
71
+ // video.width = video.offsetWidth;
72
+ const context = canvas.getContext('2d');
73
+ canvas.width = video.videoWidth;
74
+ canvas.height = video.videoHeight;
75
+ // flip horizontally back camera isn't used
76
+ if (!this.isBackCamera) {
77
+ context.translate(video.videoWidth, 0);
78
+ context.scale(-1, 1);
79
+ }
80
+ context.drawImage(video, 0, 0, video.videoWidth, video.videoHeight);
81
+ let base64EncodedImage;
82
+ if (options.quality != undefined) {
83
+ base64EncodedImage = canvas
84
+ .toDataURL('image/jpeg', options.quality / 100.0)
85
+ .replace('data:image/jpeg;base64,', '');
86
+ }
87
+ else {
88
+ base64EncodedImage = canvas.toDataURL('image/png').replace('data:image/png;base64,', '');
89
+ }
90
+ resolve({
91
+ value: base64EncodedImage,
92
+ });
93
+ });
94
+ }
95
+ async captureSample(_options) {
96
+ return this.capture(_options);
97
+ }
98
+ async getSupportedFlashModes() {
99
+ throw new Error('getSupportedFlashModes not supported under the web platform');
100
+ }
101
+ async setFlashMode(_options) {
102
+ throw new Error('setFlashMode not supported under the web platform');
103
+ }
104
+ async flip() {
105
+ throw new Error('flip not supported under the web platform');
106
+ }
107
+ async setOpacity(_options) {
108
+ const video = document.getElementById('video');
109
+ if (!!video && !!_options['opacity']) {
110
+ video.style.setProperty('opacity', _options['opacity'].toString());
111
+ }
112
+ }
113
+ async checkPermissions() {
114
+ throw new Error('checkPermissions not supported under the web platform');
115
+ }
116
+ async requestPermissions() {
117
+ throw new Error('requestPermissions not supported under the web platform');
118
+ }
119
+ }
120
+ //# sourceMappingURL=web.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAW5C,MAAM,OAAO,gBAAiB,SAAQ,SAAS;IAO7C;QACE,KAAK,EAAE,CAAC;IACV,CAAC;IAED,KAAK,CAAC,KAAK,CAAC,OAA6B;;QACvC,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,YAAY,CAAC,YAAY,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;QAE1E,kGAAkG;QAClG,MAAM,CAAC,SAAS,EAAE,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC;QAEpD,MAAM,KAAK,GAAG,QAAQ,CAAC,cAAc,CA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AAC,CAAC;IACjF,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,QAAwD;QACzE,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;IACvE,CAAC;IAED,KAAK,CAAC,IAAI;QACR,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAC;IAC/D,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,QAA8B;QAC7C,MAAM,KAAK,GAAqB,QAAQ,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;QACjE,IAAI,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC;YACrC,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,SAAS,EAAE,QAAQ,CAAC,SAAS,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;QACrE,CAAC;IACH,CAAC;IAED,KAAK,CAAC,gBAAgB;QACpB,MAAM,IAAI,KAAK,CAAC,uDAAuD,CAAC,CAAC;IAC3E,CAAC;IAED,KAAK,CAAC,kBAAkB;QACtB,MAAM,IAAI,KAAK,CAAC,yDAAyD,CAAC,CAAC;IAC7E,CAAC;CACF"}
@@ -0,0 +1,134 @@
1
+ 'use strict';
2
+
3
+ var core = require('@capacitor/core');
4
+
5
+ const CameraPreview = core.registerPlugin('CameraPreview', {
6
+ web: () => Promise.resolve().then(function () { return web; }).then((m) => new m.CameraPreviewWeb()),
7
+ });
8
+
9
+ class CameraPreviewWeb extends core.WebPlugin {
10
+ constructor() {
11
+ super();
12
+ }
13
+ async start(options) {
14
+ var _a;
15
+ const stream = await navigator.mediaDevices.getUserMedia({ video: true });
16
+ // Stop any existing stream so we can request media with different constraints based on user input
17
+ stream.getTracks().forEach((track) => track.stop());
18
+ const video = document.getElementById('video');
19
+ const parent = document.getElementById(options.parent);
20
+ if (video) {
21
+ throw new Error('camera already started');
22
+ }
23
+ const videoElement = document.createElement('video');
24
+ videoElement.id = 'video';
25
+ videoElement.setAttribute('class', options.className || '');
26
+ // Don't flip video feed if camera is rear facing
27
+ if (options.position !== 'rear') {
28
+ videoElement.setAttribute('style', '-webkit-transform: scaleX(-1); transform: scaleX(-1);');
29
+ }
30
+ const userAgent = navigator.userAgent.toLowerCase();
31
+ const isSafari = userAgent.includes('safari') && !userAgent.includes('chrome');
32
+ // Safari on iOS needs to have the autoplay, muted and playsinline attributes set for video.play() to be successful
33
+ // Without these attributes videoElement.play() will throw a NotAllowedError
34
+ // https://developer.apple.com/documentation/webkit/delivering_video_content_for_safari
35
+ if (isSafari) {
36
+ videoElement.setAttribute('autoplay', 'true');
37
+ videoElement.setAttribute('muted', 'true');
38
+ videoElement.setAttribute('playsinline', 'true');
39
+ }
40
+ parent.appendChild(videoElement);
41
+ if (!((_a = navigator.mediaDevices) === null || _a === undefined ? undefined : _a.getUserMedia)) {
42
+ throw new Error('No media devices available');
43
+ }
44
+ const constraints = {
45
+ video: {
46
+ width: { ideal: options.width },
47
+ height: { ideal: options.height },
48
+ },
49
+ };
50
+ if (options.position === 'rear') {
51
+ constraints.video.facingMode = 'environment';
52
+ this.isBackCamera = true;
53
+ }
54
+ else {
55
+ this.isBackCamera = false;
56
+ }
57
+ videoElement.srcObject = await navigator.mediaDevices.getUserMedia(constraints);
58
+ videoElement.play();
59
+ return {};
60
+ }
61
+ async stop() {
62
+ const video = document.getElementById('video');
63
+ if (video) {
64
+ video.pause();
65
+ const st = video.srcObject;
66
+ const tracks = st.getTracks();
67
+ for (let i = 0; i < tracks.length; i++) {
68
+ const track = tracks[i];
69
+ track.stop();
70
+ }
71
+ video.remove();
72
+ }
73
+ }
74
+ async capture(options) {
75
+ return new Promise((resolve, _) => {
76
+ const video = document.getElementById('video');
77
+ const canvas = document.createElement('canvas');
78
+ // video.width = video.offsetWidth;
79
+ const context = canvas.getContext('2d');
80
+ canvas.width = video.videoWidth;
81
+ canvas.height = video.videoHeight;
82
+ // flip horizontally back camera isn't used
83
+ if (!this.isBackCamera) {
84
+ context.translate(video.videoWidth, 0);
85
+ context.scale(-1, 1);
86
+ }
87
+ context.drawImage(video, 0, 0, video.videoWidth, video.videoHeight);
88
+ let base64EncodedImage;
89
+ if (options.quality != undefined) {
90
+ base64EncodedImage = canvas
91
+ .toDataURL('image/jpeg', options.quality / 100.0)
92
+ .replace('data:image/jpeg;base64,', '');
93
+ }
94
+ else {
95
+ base64EncodedImage = canvas.toDataURL('image/png').replace('data:image/png;base64,', '');
96
+ }
97
+ resolve({
98
+ value: base64EncodedImage,
99
+ });
100
+ });
101
+ }
102
+ async captureSample(_options) {
103
+ return this.capture(_options);
104
+ }
105
+ async getSupportedFlashModes() {
106
+ throw new Error('getSupportedFlashModes not supported under the web platform');
107
+ }
108
+ async setFlashMode(_options) {
109
+ throw new Error('setFlashMode not supported under the web platform');
110
+ }
111
+ async flip() {
112
+ throw new Error('flip not supported under the web platform');
113
+ }
114
+ async setOpacity(_options) {
115
+ const video = document.getElementById('video');
116
+ if (!!video && !!_options['opacity']) {
117
+ video.style.setProperty('opacity', _options['opacity'].toString());
118
+ }
119
+ }
120
+ async checkPermissions() {
121
+ throw new Error('checkPermissions not supported under the web platform');
122
+ }
123
+ async requestPermissions() {
124
+ throw new Error('requestPermissions not supported under the web platform');
125
+ }
126
+ }
127
+
128
+ var web = /*#__PURE__*/Object.freeze({
129
+ __proto__: null,
130
+ CameraPreviewWeb: CameraPreviewWeb
131
+ });
132
+
133
+ exports.CameraPreview = CameraPreview;
134
+ //# sourceMappingURL=plugin.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.cjs.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["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';\nexport class CameraPreviewWeb extends WebPlugin {\n constructor() {\n super();\n }\n async start(options) {\n var _a;\n const stream = await navigator.mediaDevices.getUserMedia({ video: true });\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 const video = document.getElementById('video');\n const parent = document.getElementById(options.parent);\n if (video) {\n throw new Error('camera already started');\n }\n const videoElement = document.createElement('video');\n videoElement.id = 'video';\n videoElement.setAttribute('class', 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.appendChild(videoElement);\n if (!((_a = navigator.mediaDevices) === null || _a === void 0 ? void 0 : _a.getUserMedia)) {\n throw new Error('No media devices available');\n }\n const constraints = {\n video: {\n width: { ideal: options.width },\n height: { ideal: options.height },\n },\n };\n if (options.position === 'rear') {\n constraints.video.facingMode = 'environment';\n this.isBackCamera = true;\n }\n else {\n this.isBackCamera = false;\n }\n videoElement.srcObject = await navigator.mediaDevices.getUserMedia(constraints);\n videoElement.play();\n return {};\n }\n async stop() {\n const video = document.getElementById('video');\n if (video) {\n video.pause();\n const st = video.srcObject;\n const tracks = st.getTracks();\n for (let i = 0; i < tracks.length; i++) {\n const track = tracks[i];\n track.stop();\n }\n video.remove();\n }\n }\n async capture(options) {\n return new Promise((resolve, _) => {\n const video = document.getElementById('video');\n const canvas = document.createElement('canvas');\n // video.width = video.offsetWidth;\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.translate(video.videoWidth, 0);\n context.scale(-1, 1);\n }\n context.drawImage(video, 0, 0, video.videoWidth, video.videoHeight);\n let base64EncodedImage;\n if (options.quality != undefined) {\n base64EncodedImage = canvas\n .toDataURL('image/jpeg', options.quality / 100.0)\n .replace('data:image/jpeg;base64,', '');\n }\n else {\n base64EncodedImage = canvas.toDataURL('image/png').replace('data:image/png;base64,', '');\n }\n resolve({\n value: base64EncodedImage,\n });\n });\n }\n async captureSample(_options) {\n return this.capture(_options);\n }\n async getSupportedFlashModes() {\n throw new Error('getSupportedFlashModes not supported under the web platform');\n }\n async setFlashMode(_options) {\n throw new Error('setFlashMode not supported under the web platform');\n }\n async flip() {\n throw new Error('flip not supported under the web platform');\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 }\n async checkPermissions() {\n throw new Error('checkPermissions not supported under the web platform');\n }\n async requestPermissions() {\n throw new Error('requestPermissions not supported under the web platform');\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;;AACK,MAAC,aAAa,GAAGA,mBAAc,CAAC,eAAe,EAAE;AACtD,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,gBAAgB,EAAE,CAAC;AACpE,CAAC;;ACFM,MAAM,gBAAgB,SAASC,cAAS,CAAC;AAChD,IAAI,WAAW,GAAG;AAClB,QAAQ,KAAK,EAAE;AACf;AACA,IAAI,MAAM,KAAK,CAAC,OAAO,EAAE;AACzB,QAAQ,IAAI,EAAE;AACd,QAAQ,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,YAAY,CAAC,YAAY,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AACjF;AACA,QAAQ,MAAM,CAAC,SAAS,EAAE,CAAC,OAAO,CAAC,CAAC,KAAK,KAAK,KAAK,CAAC,IAAI,EAAE,CAAC;AAC3D,QAAQ,MAA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AAM,IAAI,KAAK,CAAC,6DAA6D,CAAC;AACtF;AACA,IAAI,MAAM,YAAY,CAAC,QAAQ,EAAE;AACjC,QAAQ,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC;AAC5E;AACA,IAAI,MAAM,IAAI,GAAG;AACjB,QAAQ,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC;AACpE;AACA,IAAI,MAAM,UAAU,CAAC,QAAQ,EAAE;AAC/B,QAAQ,MAAM,KAAK,GAAG,QAAQ,CAAC,cAAc,CAAC,OAAO,CAAC;AACtD,QAAQ,IAAI,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE;AAC9C,YAAY,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,SAAS,EAAE,QAAQ,CAAC,SAAS,CAAC,CAAC,QAAQ,EAAE,CAAC;AAC9E;AACA;AACA,IAAI,MAAM,gBAAgB,GAAG;AAC7B,QAAQ,MAAM,IAAI,KAAK,CAAC,uDAAuD,CAAC;AAChF;AACA,IAAI,MAAM,kBAAkB,GAAG;AAC/B,QAAQ,MAAM,IAAI,KAAK,CAAC,yDAAyD,CAAC;AAClF;AACA;;;;;;;;;"}
package/dist/plugin.js ADDED
@@ -0,0 +1,137 @@
1
+ var capacitorSplashScreen = (function (exports, core) {
2
+ 'use strict';
3
+
4
+ const CameraPreview = core.registerPlugin('CameraPreview', {
5
+ web: () => Promise.resolve().then(function () { return web; }).then((m) => new m.CameraPreviewWeb()),
6
+ });
7
+
8
+ class CameraPreviewWeb extends core.WebPlugin {
9
+ constructor() {
10
+ super();
11
+ }
12
+ async start(options) {
13
+ var _a;
14
+ const stream = await navigator.mediaDevices.getUserMedia({ video: true });
15
+ // Stop any existing stream so we can request media with different constraints based on user input
16
+ stream.getTracks().forEach((track) => track.stop());
17
+ const video = document.getElementById('video');
18
+ const parent = document.getElementById(options.parent);
19
+ if (video) {
20
+ throw new Error('camera already started');
21
+ }
22
+ const videoElement = document.createElement('video');
23
+ videoElement.id = 'video';
24
+ videoElement.setAttribute('class', options.className || '');
25
+ // Don't flip video feed if camera is rear facing
26
+ if (options.position !== 'rear') {
27
+ videoElement.setAttribute('style', '-webkit-transform: scaleX(-1); transform: scaleX(-1);');
28
+ }
29
+ const userAgent = navigator.userAgent.toLowerCase();
30
+ const isSafari = userAgent.includes('safari') && !userAgent.includes('chrome');
31
+ // Safari on iOS needs to have the autoplay, muted and playsinline attributes set for video.play() to be successful
32
+ // Without these attributes videoElement.play() will throw a NotAllowedError
33
+ // https://developer.apple.com/documentation/webkit/delivering_video_content_for_safari
34
+ if (isSafari) {
35
+ videoElement.setAttribute('autoplay', 'true');
36
+ videoElement.setAttribute('muted', 'true');
37
+ videoElement.setAttribute('playsinline', 'true');
38
+ }
39
+ parent.appendChild(videoElement);
40
+ if (!((_a = navigator.mediaDevices) === null || _a === undefined ? undefined : _a.getUserMedia)) {
41
+ throw new Error('No media devices available');
42
+ }
43
+ const constraints = {
44
+ video: {
45
+ width: { ideal: options.width },
46
+ height: { ideal: options.height },
47
+ },
48
+ };
49
+ if (options.position === 'rear') {
50
+ constraints.video.facingMode = 'environment';
51
+ this.isBackCamera = true;
52
+ }
53
+ else {
54
+ this.isBackCamera = false;
55
+ }
56
+ videoElement.srcObject = await navigator.mediaDevices.getUserMedia(constraints);
57
+ videoElement.play();
58
+ return {};
59
+ }
60
+ async stop() {
61
+ const video = document.getElementById('video');
62
+ if (video) {
63
+ video.pause();
64
+ const st = video.srcObject;
65
+ const tracks = st.getTracks();
66
+ for (let i = 0; i < tracks.length; i++) {
67
+ const track = tracks[i];
68
+ track.stop();
69
+ }
70
+ video.remove();
71
+ }
72
+ }
73
+ async capture(options) {
74
+ return new Promise((resolve, _) => {
75
+ const video = document.getElementById('video');
76
+ const canvas = document.createElement('canvas');
77
+ // video.width = video.offsetWidth;
78
+ const context = canvas.getContext('2d');
79
+ canvas.width = video.videoWidth;
80
+ canvas.height = video.videoHeight;
81
+ // flip horizontally back camera isn't used
82
+ if (!this.isBackCamera) {
83
+ context.translate(video.videoWidth, 0);
84
+ context.scale(-1, 1);
85
+ }
86
+ context.drawImage(video, 0, 0, video.videoWidth, video.videoHeight);
87
+ let base64EncodedImage;
88
+ if (options.quality != undefined) {
89
+ base64EncodedImage = canvas
90
+ .toDataURL('image/jpeg', options.quality / 100.0)
91
+ .replace('data:image/jpeg;base64,', '');
92
+ }
93
+ else {
94
+ base64EncodedImage = canvas.toDataURL('image/png').replace('data:image/png;base64,', '');
95
+ }
96
+ resolve({
97
+ value: base64EncodedImage,
98
+ });
99
+ });
100
+ }
101
+ async captureSample(_options) {
102
+ return this.capture(_options);
103
+ }
104
+ async getSupportedFlashModes() {
105
+ throw new Error('getSupportedFlashModes not supported under the web platform');
106
+ }
107
+ async setFlashMode(_options) {
108
+ throw new Error('setFlashMode not supported under the web platform');
109
+ }
110
+ async flip() {
111
+ throw new Error('flip not supported under the web platform');
112
+ }
113
+ async setOpacity(_options) {
114
+ const video = document.getElementById('video');
115
+ if (!!video && !!_options['opacity']) {
116
+ video.style.setProperty('opacity', _options['opacity'].toString());
117
+ }
118
+ }
119
+ async checkPermissions() {
120
+ throw new Error('checkPermissions not supported under the web platform');
121
+ }
122
+ async requestPermissions() {
123
+ throw new Error('requestPermissions not supported under the web platform');
124
+ }
125
+ }
126
+
127
+ var web = /*#__PURE__*/Object.freeze({
128
+ __proto__: null,
129
+ CameraPreviewWeb: CameraPreviewWeb
130
+ });
131
+
132
+ exports.CameraPreview = CameraPreview;
133
+
134
+ return exports;
135
+
136
+ })({}, capacitorExports);
137
+ //# sourceMappingURL=plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["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';\nexport class CameraPreviewWeb extends WebPlugin {\n constructor() {\n super();\n }\n async start(options) {\n var _a;\n const stream = await navigator.mediaDevices.getUserMedia({ video: true });\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 const video = document.getElementById('video');\n const parent = document.getElementById(options.parent);\n if (video) {\n throw new Error('camera already started');\n }\n const videoElement = document.createElement('video');\n videoElement.id = 'video';\n videoElement.setAttribute('class', 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.appendChild(videoElement);\n if (!((_a = navigator.mediaDevices) === null || _a === void 0 ? void 0 : _a.getUserMedia)) {\n throw new Error('No media devices available');\n }\n const constraints = {\n video: {\n width: { ideal: options.width },\n height: { ideal: options.height },\n },\n };\n if (options.position === 'rear') {\n constraints.video.facingMode = 'environment';\n this.isBackCamera = true;\n }\n else {\n this.isBackCamera = false;\n }\n videoElement.srcObject = await navigator.mediaDevices.getUserMedia(constraints);\n videoElement.play();\n return {};\n }\n async stop() {\n const video = document.getElementById('video');\n if (video) {\n video.pause();\n const st = video.srcObject;\n const tracks = st.getTracks();\n for (let i = 0; i < tracks.length; i++) {\n const track = tracks[i];\n track.stop();\n }\n video.remove();\n }\n }\n async capture(options) {\n return new Promise((resolve, _) => {\n const video = document.getElementById('video');\n const canvas = document.createElement('canvas');\n // video.width = video.offsetWidth;\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.translate(video.videoWidth, 0);\n context.scale(-1, 1);\n }\n context.drawImage(video, 0, 0, video.videoWidth, video.videoHeight);\n let base64EncodedImage;\n if (options.quality != undefined) {\n base64EncodedImage = canvas\n .toDataURL('image/jpeg', options.quality / 100.0)\n .replace('data:image/jpeg;base64,', '');\n }\n else {\n base64EncodedImage = canvas.toDataURL('image/png').replace('data:image/png;base64,', '');\n }\n resolve({\n value: base64EncodedImage,\n });\n });\n }\n async captureSample(_options) {\n return this.capture(_options);\n }\n async getSupportedFlashModes() {\n throw new Error('getSupportedFlashModes not supported under the web platform');\n }\n async setFlashMode(_options) {\n throw new Error('setFlashMode not supported under the web platform');\n }\n async flip() {\n throw new Error('flip not supported under the web platform');\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 }\n async checkPermissions() {\n throw new Error('checkPermissions not supported under the web platform');\n }\n async requestPermissions() {\n throw new Error('requestPermissions not supported under the web platform');\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;AACK,UAAC,aAAa,GAAGA,mBAAc,CAAC,eAAe,EAAE;IACtD,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,gBAAgB,EAAE,CAAC;IACpE,CAAC;;ICFM,MAAM,gBAAgB,SAASC,cAAS,CAAC;IAChD,IAAI,WAAW,GAAG;IAClB,QAAQ,KAAK,EAAE;IACf;IACA,IAAI,MAAM,KAAK,CAAC,OAAO,EAAE;IACzB,QAAQ,IAAI,EAAE;IACd,QAAQ,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,YAAY,CAAC,YAAY,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;IACjF;IACA,QAAQ,MAAM,CAAC,SAAS,EAA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