@capgo/camera-preview 3.2.8 → 3.3.1
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/CapgoCameraPreview.podspec +1 -1
- package/README.md +234 -46
- package/android/.gradle/7.4.2/checksums/checksums.lock +0 -0
- package/android/.gradle/7.4.2/checksums/md5-checksums.bin +0 -0
- package/android/.gradle/7.4.2/checksums/sha1-checksums.bin +0 -0
- package/android/.gradle/7.4.2/dependencies-accessors/dependencies-accessors.lock +0 -0
- package/android/.gradle/7.4.2/dependencies-accessors/gc.properties +0 -0
- package/android/.gradle/7.4.2/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/7.4.2/fileChanges/last-build.bin +0 -0
- package/android/.gradle/7.4.2/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/7.4.2/gc.properties +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +2 -0
- package/android/.gradle/vcs-1/gc.properties +0 -0
- package/android/build.gradle +8 -8
- package/android/gradle/wrapper/gradle-wrapper.properties +2 -3
- package/android/src/main/java/com/ahm/capacitor/camera/preview/CameraActivity.java +5 -7
- package/dist/docs.json +373 -0
- package/dist/esm/definitions.d.ts +3 -3
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/web.d.ts +2 -2
- package/dist/esm/web.js +64 -65
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +148 -0
- package/dist/plugin.cjs.js.map +1 -0
- package/dist/plugin.js +151 -0
- package/dist/plugin.js.map +1 -0
- package/ios/Plugin/CameraController.swift +1 -1
- package/ios/Plugin/Plugin.swift +5 -5
- package/ios/Plugin.xcodeproj/project.pbxproj +8 -2
- package/ios/Podfile +1 -1
- package/ios/Podfile.lock +4 -4
- package/package.json +40 -35
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
s.author = 'Ariel Hernandez Musa'
|
|
9
9
|
s.source = { :git => 'https://github.com/Cap-go/camera-preview.git', :tag => s.version.to_s }
|
|
10
10
|
s.source_files = 'ios/Plugin/**/*.{swift,h,m,c,cc,mm,cpp}'
|
|
11
|
-
s.ios.deployment_target = '
|
|
11
|
+
s.ios.deployment_target = '13.0'
|
|
12
12
|
s.dependency 'Capacitor'
|
|
13
13
|
s.swift_version = '5.1'
|
|
14
14
|
end
|
package/README.md
CHANGED
|
@@ -39,25 +39,31 @@ or
|
|
|
39
39
|
|
|
40
40
|
npm install @capgo/camera-preview
|
|
41
41
|
```
|
|
42
|
+
|
|
42
43
|
Then run
|
|
44
|
+
|
|
43
45
|
```
|
|
44
46
|
npx cap sync
|
|
45
47
|
```
|
|
46
48
|
|
|
47
49
|
## Extra Android installation steps
|
|
50
|
+
|
|
48
51
|
**Important** `camera-preview` 3+ requires Gradle 7.
|
|
49
52
|
Open `android/app/src/main/AndroidManifest.xml` and above the closing `</manifest>` tag add this line to request the CAMERA permission:
|
|
53
|
+
|
|
50
54
|
```xml
|
|
51
55
|
<uses-permission android:name="android.permission.CAMERA" />
|
|
52
56
|
```
|
|
57
|
+
|
|
53
58
|
For more help consult the [Capacitor docs](https://capacitorjs.com/docs/android/configuration#configuring-androidmanifestxml).
|
|
54
59
|
|
|
55
60
|
## Extra iOS installation steps
|
|
61
|
+
|
|
56
62
|
You will need to add two permissions to `Info.plist`. Follow the [Capacitor docs](https://capacitorjs.com/docs/ios/configuration#configuring-infoplist) and add permissions with the raw keys `NSCameraUsageDescription` and `NSMicrophoneUsageDescription`. `NSMicrophoneUsageDescription` is only required, if audio will be used. Otherwise set the `disableAudio` option to `true`, which also disables the microphone permission request.
|
|
57
63
|
|
|
58
64
|
## Extra Web installation steps
|
|
59
|
-
Add `import '@capgo/camera-preview'` to you entry script in ionic on `app.module.ts`, so capacitor can register the web platform from the plugin
|
|
60
65
|
|
|
66
|
+
Add `import '@capgo/camera-preview'` to you entry script in ionic on `app.module.ts`, so capacitor can register the web platform from the plugin
|
|
61
67
|
|
|
62
68
|
# Methods
|
|
63
69
|
|
|
@@ -66,23 +72,23 @@ Add `import '@capgo/camera-preview'` to you entry script in ionic on `app.module
|
|
|
66
72
|
Starts the camera preview instance.
|
|
67
73
|
<br>
|
|
68
74
|
|
|
69
|
-
| Option
|
|
70
|
-
|
|
71
|
-
| position
|
|
72
|
-
| width
|
|
73
|
-
| height
|
|
74
|
-
| x
|
|
75
|
-
| y
|
|
76
|
-
| toBack
|
|
77
|
-
| paddingBottom
|
|
78
|
-
| rotateWhenOrientationChanged | boolean
|
|
79
|
-
| storeToFile
|
|
80
|
-
| disableExifHeaderStripping
|
|
81
|
-
| enableHighResolution
|
|
82
|
-
| disableAudio
|
|
83
|
-
| lockAndroidOrientation
|
|
84
|
-
| enableOpacity
|
|
85
|
-
| enableZoom
|
|
75
|
+
| Option | values | descriptions |
|
|
76
|
+
| ---------------------------- | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
77
|
+
| position | front \| rear | Show front or rear camera when start the preview. Defaults to front |
|
|
78
|
+
| width | number | (optional) The preview width in pixels, default window.screen.width (applicable to the android and ios platforms only) |
|
|
79
|
+
| height | number | (optional) The preview height in pixels, default window.screen.height (applicable to the android and ios platforms only) |
|
|
80
|
+
| x | number | (optional) The x origin, default 0 (applicable to the android and ios platforms only) |
|
|
81
|
+
| y | number | (optional) The y origin, default 0 (applicable to the android and ios platforms only) |
|
|
82
|
+
| toBack | boolean | (optional) Brings your html in front of your preview, default false (applicable to the android and ios platforms only) |
|
|
83
|
+
| paddingBottom | number | (optional) The preview bottom padding in pixes. Useful to keep the appropriate preview sizes when orientation changes (applicable to the android and ios platforms only) |
|
|
84
|
+
| rotateWhenOrientationChanged | boolean | (optional) Rotate preview when orientation changes (applicable to the ios platforms only; default value is true) |
|
|
85
|
+
| storeToFile | boolean | (optional) Capture images to a file and return back the file path instead of returning base64 encoded data, default false. |
|
|
86
|
+
| disableExifHeaderStripping | boolean | (optional) Disable automatic rotation of the image, and let the browser deal with it, default true (applicable to the android and ios platforms only) |
|
|
87
|
+
| enableHighResolution | boolean | (optional) Defaults to false - iOS only - Activate high resolution image capture so that output images are from the highest resolution possible on the device |
|
|
88
|
+
| disableAudio | boolean | (optional) Disables audio stream to prevent permission requests, default false. (applicable to web and iOS only) |
|
|
89
|
+
| lockAndroidOrientation | boolean | (optional) Locks device orientation when camera is showing, default false. (applicable to Android only) |
|
|
90
|
+
| enableOpacity | boolean | (optional) Make the camera preview see-through. Ideal for augmented reality uses. Default false (applicable to Android and web only) |
|
|
91
|
+
| enableZoom | boolean | (optional) Set if you can pinch to zoom. Default false (applicable to the android and ios platforms only) |
|
|
86
92
|
|
|
87
93
|
<!-- <strong>Options:</strong>
|
|
88
94
|
All options stated are optional and will default to values here
|
|
@@ -105,7 +111,7 @@ import { CameraPreview, CameraPreviewOptions } from '@capgo/camera-preview';
|
|
|
105
111
|
const cameraPreviewOptions: CameraPreviewOptions = {
|
|
106
112
|
position: 'rear',
|
|
107
113
|
height: 1920,
|
|
108
|
-
width: 1080
|
|
114
|
+
width: 1080,
|
|
109
115
|
};
|
|
110
116
|
CameraPreview.start(cameraPreviewOptions);
|
|
111
117
|
```
|
|
@@ -127,7 +133,8 @@ Take into account that this will make transparent all ion-content on application
|
|
|
127
133
|
```
|
|
128
134
|
|
|
129
135
|
If the camera preview is not displaying after applying the above styles, apply transparent background color to the root div element of the parent component
|
|
130
|
-
Ex: VueJS >> App.vue component
|
|
136
|
+
Ex: VueJS >> App.vue component
|
|
137
|
+
|
|
131
138
|
```html
|
|
132
139
|
<template>
|
|
133
140
|
<ion-app id="app">
|
|
@@ -142,7 +149,6 @@ Ex: VueJS >> App.vue component
|
|
|
142
149
|
<style>
|
|
143
150
|
```
|
|
144
151
|
|
|
145
|
-
|
|
146
152
|
### stop()
|
|
147
153
|
|
|
148
154
|
<info>Stops the camera preview instance.</info><br/>
|
|
@@ -152,9 +158,11 @@ CameraPreview.stop();
|
|
|
152
158
|
```
|
|
153
159
|
|
|
154
160
|
### flip()
|
|
161
|
+
|
|
155
162
|
<info>Switch between rear and front camera only for android and ios, web is not supported</info>
|
|
163
|
+
|
|
156
164
|
```javascript
|
|
157
|
-
CameraPreview.flip()
|
|
165
|
+
CameraPreview.flip();
|
|
158
166
|
```
|
|
159
167
|
|
|
160
168
|
<!-- ### switchCamera([successCallback, errorCallback])
|
|
@@ -183,11 +191,11 @@ CameraPreview.hide();
|
|
|
183
191
|
|
|
184
192
|
### capture(options)
|
|
185
193
|
|
|
186
|
-
| Option
|
|
187
|
-
|
|
188
|
-
| quality
|
|
189
|
-
| width
|
|
190
|
-
| height
|
|
194
|
+
| Option | values | descriptions |
|
|
195
|
+
| ------- | ------ | --------------------------------------------------------- |
|
|
196
|
+
| quality | number | (optional) The picture quality, 0 - 100, default 85 |
|
|
197
|
+
| width | number | (optional) The picture width, default 0 (Device default) |
|
|
198
|
+
| height | number | (optional) The picture height, default 0 (Device default) |
|
|
191
199
|
|
|
192
200
|
<!-- <info>Take the picture. If width and height are not specified or are 0 it will use the defaults. If width and height are specified, it will choose a supported photo size that is closest to width and height specified and has closest aspect ratio to the preview. The argument `quality` defaults to `85` and specifies the quality/compression value: `0=max compression`, `100=max quality`.</info><br/> -->
|
|
193
201
|
|
|
@@ -195,21 +203,20 @@ CameraPreview.hide();
|
|
|
195
203
|
import { CameraPreviewPictureOptions } from '@capgo/camera-preview';
|
|
196
204
|
|
|
197
205
|
const cameraPreviewPictureOptions: CameraPreviewPictureOptions = {
|
|
198
|
-
quality: 50
|
|
206
|
+
quality: 50,
|
|
199
207
|
};
|
|
200
208
|
|
|
201
209
|
const result = await CameraPreview.capture(cameraPreviewPictureOptions);
|
|
202
210
|
const base64PictureData = result.value;
|
|
203
211
|
|
|
204
212
|
// do sometime with base64PictureData
|
|
205
|
-
|
|
206
213
|
```
|
|
207
214
|
|
|
208
215
|
### captureSample(options)
|
|
209
216
|
|
|
210
|
-
| Option
|
|
211
|
-
|
|
212
|
-
| quality
|
|
217
|
+
| Option | values | descriptions |
|
|
218
|
+
| ------- | ------ | --------------------------------------------------- |
|
|
219
|
+
| quality | number | (optional) The picture quality, 0 - 100, default 85 |
|
|
213
220
|
|
|
214
221
|
<info>Captures a sample image from the video stream. Only for Android and iOS, web implementation falls back to `capture` method. This can be used to perform real-time analysis on the current frame in the video. The argument `quality` defaults to `85` and specifies the quality/compression value: `0=max compression`, `100=max quality`.</info><br/>
|
|
215
222
|
|
|
@@ -217,14 +224,13 @@ const base64PictureData = result.value;
|
|
|
217
224
|
import { CameraSampleOptions } from '@capgo/camera-preview';
|
|
218
225
|
|
|
219
226
|
const cameraSampleOptions: CameraSampleOptions = {
|
|
220
|
-
quality: 50
|
|
227
|
+
quality: 50,
|
|
221
228
|
};
|
|
222
229
|
|
|
223
230
|
const result = await CameraPreview.captureSample(cameraSampleOptions);
|
|
224
231
|
const base64PictureData = result.value;
|
|
225
232
|
|
|
226
233
|
// do something with base64PictureData
|
|
227
|
-
|
|
228
234
|
```
|
|
229
235
|
|
|
230
236
|
### getSupportedFlashModes()
|
|
@@ -237,6 +243,7 @@ import { CameraPreviewFlashMode } from '@capgo/camera-preview';
|
|
|
237
243
|
const flashModes = await CameraPreview.getSupportedFlashModes();
|
|
238
244
|
const supportedFlashModes: CameraPreviewFlashMode[] = flashModes.result;
|
|
239
245
|
```
|
|
246
|
+
|
|
240
247
|
### setFlashMode(options)
|
|
241
248
|
|
|
242
249
|
<info>Set the flash mode. See <code>[FLASH_MODE](#camera_Settings.FlashMode)</code> for details about the possible values for flashMode.</info><br/>
|
|
@@ -247,7 +254,7 @@ const CameraPreviewFlashMode: CameraPreviewFlashMode = 'torch';
|
|
|
247
254
|
CameraPreview.setFlashMode(cameraPreviewFlashMode);
|
|
248
255
|
```
|
|
249
256
|
|
|
250
|
-
### startRecordVideo(options)
|
|
257
|
+
### startRecordVideo(options) ---- ANDROID only
|
|
251
258
|
|
|
252
259
|
<info>Start capturing video</info><br/>
|
|
253
260
|
|
|
@@ -261,7 +268,7 @@ const cameraPreviewOptions: CameraPreviewOptions = {
|
|
|
261
268
|
CameraPreview.startRecordVideo(cameraPreviewOptions);
|
|
262
269
|
```
|
|
263
270
|
|
|
264
|
-
### stopRecordVideo()
|
|
271
|
+
### stopRecordVideo() ---- ANDROID only
|
|
265
272
|
|
|
266
273
|
<info>Finish capturing a video. The captured video will be returned as a file path and the video format is .mp4</info><br/>
|
|
267
274
|
|
|
@@ -270,13 +277,13 @@ const resultRecordVideo = await CameraPreview.stopRecordVideo();
|
|
|
270
277
|
this.stopCamera();
|
|
271
278
|
```
|
|
272
279
|
|
|
273
|
-
### setOpacity(options: CameraOpacityOptions): Promise<{}>;
|
|
280
|
+
### setOpacity(options: CameraOpacityOptions): Promise<{}>; ---- ANDROID only
|
|
274
281
|
|
|
275
282
|
<info>Set the opacity for the camera preview</info><br/>
|
|
276
283
|
|
|
277
284
|
```javascript
|
|
278
|
-
const myCamera = CameraPreview.start({enableOpacity: true});
|
|
279
|
-
myCamera.setOpacity({opacity: 0.4});
|
|
285
|
+
const myCamera = CameraPreview.start({ enableOpacity: true });
|
|
286
|
+
myCamera.setOpacity({ opacity: 0.4 });
|
|
280
287
|
```
|
|
281
288
|
|
|
282
289
|
# Settings
|
|
@@ -287,13 +294,13 @@ myCamera.setOpacity({opacity: 0.4});
|
|
|
287
294
|
|
|
288
295
|
<info>Flash mode settings:</info><br/>
|
|
289
296
|
|
|
290
|
-
| Name | Type
|
|
291
|
-
| ------- |
|
|
292
|
-
| OFF | string
|
|
293
|
-
| ON | string
|
|
294
|
-
| AUTO | string
|
|
295
|
-
| RED_EYE | string
|
|
296
|
-
| TORCH | string
|
|
297
|
+
| Name | Type | Default | Note |
|
|
298
|
+
| ------- | ------ | ------- | ------------ |
|
|
299
|
+
| OFF | string | off | |
|
|
300
|
+
| ON | string | on | |
|
|
301
|
+
| AUTO | string | auto | |
|
|
302
|
+
| RED_EYE | string | red-eye | Android Only |
|
|
303
|
+
| TORCH | string | torch | |
|
|
297
304
|
|
|
298
305
|
<!--
|
|
299
306
|
|
|
@@ -428,3 +435,184 @@ Created by Marcel Barbosa Pinto [@mbppower](https://github.com/mbppower)
|
|
|
428
435
|
A working example can be found at [Demo](https://github.com/capacitor-community/camera-preview/tree/master/demo)
|
|
429
436
|
|
|
430
437
|
To run the demo on your local network and access media devices, a secure context is needed. Add an `.env` file at the root of the demo folder with `HTTPS=true` to start react with HTTPS.
|
|
438
|
+
|
|
439
|
+
## API
|
|
440
|
+
|
|
441
|
+
<docgen-index>
|
|
442
|
+
|
|
443
|
+
* [`start(...)`](#start)
|
|
444
|
+
* [`stop()`](#stop)
|
|
445
|
+
* [`capture(...)`](#capture)
|
|
446
|
+
* [`captureSample(...)`](#capturesample)
|
|
447
|
+
* [`getSupportedFlashModes()`](#getsupportedflashmodes)
|
|
448
|
+
* [`setFlashMode(...)`](#setflashmode)
|
|
449
|
+
* [`flip()`](#flip)
|
|
450
|
+
* [`setOpacity(...)`](#setopacity)
|
|
451
|
+
* [Interfaces](#interfaces)
|
|
452
|
+
* [Type Aliases](#type-aliases)
|
|
453
|
+
|
|
454
|
+
</docgen-index>
|
|
455
|
+
|
|
456
|
+
<docgen-api>
|
|
457
|
+
<!--Update the source file JSDoc comments and rerun docgen to update the docs below-->
|
|
458
|
+
|
|
459
|
+
### start(...)
|
|
460
|
+
|
|
461
|
+
```typescript
|
|
462
|
+
start(options: CameraPreviewOptions) => Promise<void>
|
|
463
|
+
```
|
|
464
|
+
|
|
465
|
+
| Param | Type |
|
|
466
|
+
| ------------- | --------------------------------------------------------------------- |
|
|
467
|
+
| **`options`** | <code><a href="#camerapreviewoptions">CameraPreviewOptions</a></code> |
|
|
468
|
+
|
|
469
|
+
--------------------
|
|
470
|
+
|
|
471
|
+
|
|
472
|
+
### stop()
|
|
473
|
+
|
|
474
|
+
```typescript
|
|
475
|
+
stop() => Promise<void>
|
|
476
|
+
```
|
|
477
|
+
|
|
478
|
+
--------------------
|
|
479
|
+
|
|
480
|
+
|
|
481
|
+
### capture(...)
|
|
482
|
+
|
|
483
|
+
```typescript
|
|
484
|
+
capture(options: CameraPreviewPictureOptions) => Promise<{ value: string; }>
|
|
485
|
+
```
|
|
486
|
+
|
|
487
|
+
| Param | Type |
|
|
488
|
+
| ------------- | ----------------------------------------------------------------------------------- |
|
|
489
|
+
| **`options`** | <code><a href="#camerapreviewpictureoptions">CameraPreviewPictureOptions</a></code> |
|
|
490
|
+
|
|
491
|
+
**Returns:** <code>Promise<{ value: string; }></code>
|
|
492
|
+
|
|
493
|
+
--------------------
|
|
494
|
+
|
|
495
|
+
|
|
496
|
+
### captureSample(...)
|
|
497
|
+
|
|
498
|
+
```typescript
|
|
499
|
+
captureSample(options: CameraSampleOptions) => Promise<{ value: string; }>
|
|
500
|
+
```
|
|
501
|
+
|
|
502
|
+
| Param | Type |
|
|
503
|
+
| ------------- | ------------------------------------------------------------------- |
|
|
504
|
+
| **`options`** | <code><a href="#camerasampleoptions">CameraSampleOptions</a></code> |
|
|
505
|
+
|
|
506
|
+
**Returns:** <code>Promise<{ value: string; }></code>
|
|
507
|
+
|
|
508
|
+
--------------------
|
|
509
|
+
|
|
510
|
+
|
|
511
|
+
### getSupportedFlashModes()
|
|
512
|
+
|
|
513
|
+
```typescript
|
|
514
|
+
getSupportedFlashModes() => Promise<{ result: CameraPreviewFlashMode[]; }>
|
|
515
|
+
```
|
|
516
|
+
|
|
517
|
+
**Returns:** <code>Promise<{ result: CameraPreviewFlashMode[]; }></code>
|
|
518
|
+
|
|
519
|
+
--------------------
|
|
520
|
+
|
|
521
|
+
|
|
522
|
+
### setFlashMode(...)
|
|
523
|
+
|
|
524
|
+
```typescript
|
|
525
|
+
setFlashMode(options: { flashMode: CameraPreviewFlashMode | string; }) => Promise<void>
|
|
526
|
+
```
|
|
527
|
+
|
|
528
|
+
| Param | Type |
|
|
529
|
+
| ------------- | ----------------------------------- |
|
|
530
|
+
| **`options`** | <code>{ flashMode: string; }</code> |
|
|
531
|
+
|
|
532
|
+
--------------------
|
|
533
|
+
|
|
534
|
+
|
|
535
|
+
### flip()
|
|
536
|
+
|
|
537
|
+
```typescript
|
|
538
|
+
flip() => Promise<void>
|
|
539
|
+
```
|
|
540
|
+
|
|
541
|
+
--------------------
|
|
542
|
+
|
|
543
|
+
|
|
544
|
+
### setOpacity(...)
|
|
545
|
+
|
|
546
|
+
```typescript
|
|
547
|
+
setOpacity(options: CameraOpacityOptions) => Promise<void>
|
|
548
|
+
```
|
|
549
|
+
|
|
550
|
+
| Param | Type |
|
|
551
|
+
| ------------- | --------------------------------------------------------------------- |
|
|
552
|
+
| **`options`** | <code><a href="#cameraopacityoptions">CameraOpacityOptions</a></code> |
|
|
553
|
+
|
|
554
|
+
--------------------
|
|
555
|
+
|
|
556
|
+
|
|
557
|
+
### Interfaces
|
|
558
|
+
|
|
559
|
+
|
|
560
|
+
#### CameraPreviewOptions
|
|
561
|
+
|
|
562
|
+
| Prop | Type | Description |
|
|
563
|
+
| ---------------------------------- | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
564
|
+
| **`parent`** | <code>string</code> | Parent element to attach the video preview element to (applicable to the web platform only) |
|
|
565
|
+
| **`className`** | <code>string</code> | Class name to add to the video preview element (applicable to the web platform only) |
|
|
566
|
+
| **`width`** | <code>number</code> | The preview width in pixels, default window.screen.width |
|
|
567
|
+
| **`height`** | <code>number</code> | The preview height in pixels, default window.screen.height |
|
|
568
|
+
| **`x`** | <code>number</code> | The x origin, default 0 (applicable to the android and ios platforms only) |
|
|
569
|
+
| **`y`** | <code>number</code> | The y origin, default 0 (applicable to the android and ios platforms only) |
|
|
570
|
+
| **`toBack`** | <code>boolean</code> | Brings your html in front of your preview, default false (applicable to the android only) |
|
|
571
|
+
| **`paddingBottom`** | <code>number</code> | The preview bottom padding in pixes. Useful to keep the appropriate preview sizes when orientation changes (applicable to the android and ios platforms only) |
|
|
572
|
+
| **`rotateWhenOrientationChanged`** | <code>boolean</code> | Rotate preview when orientation changes (applicable to the ios platforms only; default value is true) |
|
|
573
|
+
| **`position`** | <code>string</code> | Choose the camera to use 'front' or 'rear', default 'front' |
|
|
574
|
+
| **`storeToFile`** | <code>boolean</code> | Defaults to false - Capture images to a file and return the file path instead of returning base64 encoded data |
|
|
575
|
+
| **`disableExifHeaderStripping`** | <code>boolean</code> | Defaults to false - Android Only - Disable automatic rotation of the image, and let the browser deal with it (keep reading on how to achieve it) |
|
|
576
|
+
| **`enableHighResolution`** | <code>boolean</code> | Defaults to false - iOS only - Activate high resolution image capture so that output images are from the highest resolution possible on the device * |
|
|
577
|
+
| **`disableAudio`** | <code>boolean</code> | Defaults to false - Web only - Disables audio stream to prevent permission requests and output switching |
|
|
578
|
+
| **`lockAndroidOrientation`** | <code>boolean</code> | Android Only - Locks device orientation when camera is showing. |
|
|
579
|
+
| **`enableOpacity`** | <code>boolean</code> | Defaults to false - Android and Web only. Set if camera preview can change opacity. |
|
|
580
|
+
| **`enableZoom`** | <code>boolean</code> | Defaults to false - Android only. Set if camera preview will support pinch to zoom. |
|
|
581
|
+
|
|
582
|
+
|
|
583
|
+
#### CameraPreviewPictureOptions
|
|
584
|
+
|
|
585
|
+
| Prop | Type | Description |
|
|
586
|
+
| ------------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
587
|
+
| **`height`** | <code>number</code> | The picture height, optional, default 0 (Device default) |
|
|
588
|
+
| **`width`** | <code>number</code> | The picture width, optional, default 0 (Device default) |
|
|
589
|
+
| **`quality`** | <code>number</code> | The picture quality, 0 - 100, default 85 on `iOS/Android`. If left undefined, the `web` implementation will export a PNG, otherwise a JPEG will be generated |
|
|
590
|
+
|
|
591
|
+
|
|
592
|
+
#### CameraSampleOptions
|
|
593
|
+
|
|
594
|
+
| Prop | Type | Description |
|
|
595
|
+
| ------------- | ------------------- | ---------------------------------------- |
|
|
596
|
+
| **`quality`** | <code>number</code> | The picture quality, 0 - 100, default 85 |
|
|
597
|
+
|
|
598
|
+
|
|
599
|
+
#### CameraOpacityOptions
|
|
600
|
+
|
|
601
|
+
| Prop | Type | Description |
|
|
602
|
+
| ------------- | ------------------- | ----------------------------------------------------- |
|
|
603
|
+
| **`opacity`** | <code>number</code> | The percent opacity to set for camera view, default 1 |
|
|
604
|
+
|
|
605
|
+
|
|
606
|
+
### Type Aliases
|
|
607
|
+
|
|
608
|
+
|
|
609
|
+
#### CameraPosition
|
|
610
|
+
|
|
611
|
+
<code>'rear' | 'front'</code>
|
|
612
|
+
|
|
613
|
+
|
|
614
|
+
#### CameraPreviewFlashMode
|
|
615
|
+
|
|
616
|
+
<code>'off' | 'on' | 'auto' | 'red-eye' | 'torch'</code>
|
|
617
|
+
|
|
618
|
+
</docgen-api>
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
|
Binary file
|
|
File without changes
|
package/android/build.gradle
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
ext {
|
|
2
|
-
junitVersion =
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2'
|
|
3
|
+
androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.3'
|
|
4
|
+
androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.4.0'
|
|
5
|
+
androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.4.2'
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
buildscript {
|
|
@@ -11,17 +11,17 @@ buildscript {
|
|
|
11
11
|
google()
|
|
12
12
|
}
|
|
13
13
|
dependencies {
|
|
14
|
-
classpath 'com.android.tools.build:gradle:
|
|
14
|
+
classpath 'com.android.tools.build:gradle:7.2.1'
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
apply plugin: 'com.android.library'
|
|
19
19
|
|
|
20
20
|
android {
|
|
21
|
-
compileSdkVersion project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion :
|
|
21
|
+
compileSdkVersion project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 32
|
|
22
22
|
defaultConfig {
|
|
23
|
-
minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion :
|
|
24
|
-
targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion :
|
|
23
|
+
minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 22
|
|
24
|
+
targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 32
|
|
25
25
|
versionCode 1
|
|
26
26
|
versionName "1.0"
|
|
27
27
|
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
#Fri Dec 01 12:41:00 CST 2017
|
|
2
1
|
distributionBase=GRADLE_USER_HOME
|
|
3
2
|
distributionPath=wrapper/dists
|
|
3
|
+
distributionUrl=https://services.gradle.org/distributions/gradle-7.4.2-bin.zip
|
|
4
4
|
zipStoreBase=GRADLE_USER_HOME
|
|
5
|
-
zipStorePath=wrapper/dists
|
|
6
|
-
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip
|
|
5
|
+
zipStorePath=wrapper/dists
|
|
@@ -396,15 +396,16 @@ public class CameraActivity extends Fragment {
|
|
|
396
396
|
super.onConfigurationChanged(newConfig);
|
|
397
397
|
|
|
398
398
|
final FrameLayout frameContainerLayout = (FrameLayout) view.findViewById(
|
|
399
|
-
|
|
399
|
+
getResources().getIdentifier("frame_container", "id", appResourcesPackage)
|
|
400
400
|
);
|
|
401
401
|
|
|
402
|
-
final int previousOrientation = frameContainerLayout.getHeight() > frameContainerLayout.getWidth()
|
|
402
|
+
final int previousOrientation = frameContainerLayout.getHeight() > frameContainerLayout.getWidth()
|
|
403
|
+
? Configuration.ORIENTATION_PORTRAIT
|
|
404
|
+
: Configuration.ORIENTATION_LANDSCAPE;
|
|
403
405
|
// Checks if the orientation of the screen has changed
|
|
404
406
|
if (newConfig.orientation != previousOrientation) {
|
|
405
|
-
|
|
406
407
|
final RelativeLayout frameCamContainerLayout = (RelativeLayout) view.findViewById(
|
|
407
|
-
|
|
408
|
+
getResources().getIdentifier("frame_camera_cont", "id", appResourcesPackage)
|
|
408
409
|
);
|
|
409
410
|
|
|
410
411
|
frameContainerLayout.getLayoutParams().width = frameCamContainerLayout.getHeight();
|
|
@@ -419,12 +420,9 @@ public class CameraActivity extends Fragment {
|
|
|
419
420
|
frameCamContainerLayout.forceLayout();
|
|
420
421
|
|
|
421
422
|
mPreview.setCameraDisplayOrientation();
|
|
422
|
-
|
|
423
423
|
}
|
|
424
|
-
|
|
425
424
|
}
|
|
426
425
|
|
|
427
|
-
|
|
428
426
|
public Camera getCamera() {
|
|
429
427
|
return mCamera;
|
|
430
428
|
}
|