capacitor-community-multilens-camerapreview 0.0.10 → 0.0.11-a
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/CapacitorCommunityMultilensCamerapreview.podspec +17 -17
- package/README.md +26 -16
- package/android/build.gradle +55 -55
- package/android/src/main/AndroidManifest.xml +4 -4
- package/android/src/main/java/com/ahm/capacitor/camera/preview/CameraActivity.java +1008 -1008
- package/android/src/main/java/com/ahm/capacitor/camera/preview/CameraPreview.java +544 -544
- package/android/src/main/java/com/ahm/capacitor/camera/preview/CustomSurfaceView.java +23 -23
- package/android/src/main/java/com/ahm/capacitor/camera/preview/CustomTextureView.java +29 -29
- package/android/src/main/java/com/ahm/capacitor/camera/preview/Preview.java +386 -386
- package/android/src/main/java/com/ahm/capacitor/camera/preview/TapGestureDetector.java +24 -24
- package/android/src/main/res/layout/bridge_layout_main.xml +15 -15
- package/android/src/main/res/layout/camera_activity.xml +68 -68
- package/android/src/main/res/values/camera_ids.xml +4 -4
- package/android/src/main/res/values/camera_theme.xml +9 -9
- package/android/src/main/res/values/colors.xml +3 -3
- package/android/src/main/res/values/strings.xml +3 -3
- package/android/src/main/res/values/styles.xml +3 -3
- package/dist/docs.json +11 -1
- package/dist/esm/definitions.d.ts +81 -80
- package/dist/esm/definitions.js +1 -1
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/index.d.ts +4 -4
- package/dist/esm/index.js +6 -6
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/web.d.ts +29 -28
- package/dist/esm/web.js +158 -155
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +152 -149
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +152 -149
- package/dist/plugin.js.map +1 -1
- package/ios/Plugin/CameraController.swift +783 -733
- package/ios/Plugin/Info.plist +24 -24
- package/ios/Plugin/Plugin.h +10 -10
- package/ios/Plugin/Plugin.m +19 -18
- package/ios/Plugin/Plugin.swift +316 -308
- package/package.json +78 -78
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
package com.ahm.capacitor.camera.preview;
|
|
2
|
-
|
|
3
|
-
import android.view.GestureDetector;
|
|
4
|
-
import android.view.MotionEvent;
|
|
5
|
-
|
|
6
|
-
class TapGestureDetector extends GestureDetector.SimpleOnGestureListener {
|
|
7
|
-
|
|
8
|
-
private final String TAG = "TapGestureDetector";
|
|
9
|
-
|
|
10
|
-
@Override
|
|
11
|
-
public boolean onDown(MotionEvent e) {
|
|
12
|
-
return false;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
@Override
|
|
16
|
-
public boolean onSingleTapUp(MotionEvent e) {
|
|
17
|
-
return true;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
@Override
|
|
21
|
-
public boolean onSingleTapConfirmed(MotionEvent e) {
|
|
22
|
-
return true;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
1
|
+
package com.ahm.capacitor.camera.preview;
|
|
2
|
+
|
|
3
|
+
import android.view.GestureDetector;
|
|
4
|
+
import android.view.MotionEvent;
|
|
5
|
+
|
|
6
|
+
class TapGestureDetector extends GestureDetector.SimpleOnGestureListener {
|
|
7
|
+
|
|
8
|
+
private final String TAG = "TapGestureDetector";
|
|
9
|
+
|
|
10
|
+
@Override
|
|
11
|
+
public boolean onDown(MotionEvent e) {
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
@Override
|
|
16
|
+
public boolean onSingleTapUp(MotionEvent e) {
|
|
17
|
+
return true;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
@Override
|
|
21
|
+
public boolean onSingleTapConfirmed(MotionEvent e) {
|
|
22
|
+
return true;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
-
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
3
|
-
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
4
|
-
xmlns:tools="http://schemas.android.com/tools"
|
|
5
|
-
android:layout_width="match_parent"
|
|
6
|
-
android:layout_height="match_parent"
|
|
7
|
-
tools:context="com.getcapacitor.BridgeActivity"
|
|
8
|
-
>
|
|
9
|
-
|
|
10
|
-
<WebView
|
|
11
|
-
android:id="@+id/webview"
|
|
12
|
-
android:layout_width="fill_parent"
|
|
13
|
-
android:layout_height="fill_parent" />
|
|
14
|
-
|
|
15
|
-
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
3
|
+
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
4
|
+
xmlns:tools="http://schemas.android.com/tools"
|
|
5
|
+
android:layout_width="match_parent"
|
|
6
|
+
android:layout_height="match_parent"
|
|
7
|
+
tools:context="com.getcapacitor.BridgeActivity"
|
|
8
|
+
>
|
|
9
|
+
|
|
10
|
+
<WebView
|
|
11
|
+
android:id="@+id/webview"
|
|
12
|
+
android:layout_width="fill_parent"
|
|
13
|
+
android:layout_height="fill_parent" />
|
|
14
|
+
|
|
15
|
+
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
|
@@ -1,68 +1,68 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
-
<FrameLayout
|
|
3
|
-
android:layout_width="match_parent"
|
|
4
|
-
android:layout_height="match_parent"
|
|
5
|
-
tools:context="com.ahm.capacitor.camera.preview.CameraActivity"
|
|
6
|
-
android:id="@+id/frame_container"
|
|
7
|
-
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
8
|
-
xmlns:tools="http://schemas.android.com/tools"
|
|
9
|
-
android:layout_gravity="center_horizontal|top"
|
|
10
|
-
android:layout_weight=".7">
|
|
11
|
-
|
|
12
|
-
<RelativeLayout
|
|
13
|
-
android:layout_width="match_parent"
|
|
14
|
-
android:layout_height="match_parent"
|
|
15
|
-
android:gravity="center_horizontal|top"
|
|
16
|
-
android:id="@+id/frame_camera_cont"
|
|
17
|
-
android:layout_gravity="center_horizontal|top">
|
|
18
|
-
|
|
19
|
-
<FrameLayout
|
|
20
|
-
android:layout_width="match_parent"
|
|
21
|
-
android:layout_height="match_parent"
|
|
22
|
-
android:id="@+id/video_view"
|
|
23
|
-
|
|
24
|
-
android:scaleType="fitXY"
|
|
25
|
-
android:layout_gravity="top" />
|
|
26
|
-
|
|
27
|
-
<ImageView
|
|
28
|
-
android:layout_width="match_parent"
|
|
29
|
-
android:layout_height="match_parent"
|
|
30
|
-
android:id="@+id/picture_view"
|
|
31
|
-
android:layout_gravity="center|bottom"
|
|
32
|
-
android:adjustViewBounds="true"
|
|
33
|
-
android:scaleType="fitXY" />
|
|
34
|
-
|
|
35
|
-
<ImageView
|
|
36
|
-
android:layout_width="match_parent"
|
|
37
|
-
android:layout_height="match_parent"
|
|
38
|
-
android:id="@+id/frame_view"
|
|
39
|
-
android:layout_gravity="center_horizontal|bottom"
|
|
40
|
-
android:adjustViewBounds="true"
|
|
41
|
-
android:scaleType="centerInside" />
|
|
42
|
-
|
|
43
|
-
</RelativeLayout>
|
|
44
|
-
|
|
45
|
-
<FrameLayout
|
|
46
|
-
android:layout_width="match_parent"
|
|
47
|
-
android:layout_height="match_parent"
|
|
48
|
-
android:id="@+id/camera_loader"
|
|
49
|
-
android:scaleType="fitXY"
|
|
50
|
-
android:layout_gravity="top"
|
|
51
|
-
android:layout_alignWithParentIfMissing="false"
|
|
52
|
-
android:layout_alignParentTop="false"
|
|
53
|
-
android:layout_alignParentLeft="false"
|
|
54
|
-
android:layout_alignParentBottom="false"
|
|
55
|
-
android:layout_alignParentRight="false"
|
|
56
|
-
android:visibility="invisible"
|
|
57
|
-
android:background="#ff000000">
|
|
58
|
-
|
|
59
|
-
<ProgressBar
|
|
60
|
-
android:layout_width="wrap_content"
|
|
61
|
-
android:layout_height="wrap_content"
|
|
62
|
-
android:id="@+id/camera_loader_spinner"
|
|
63
|
-
android:layout_gravity="center"
|
|
64
|
-
android:indeterminate="false"
|
|
65
|
-
android:indeterminateBehavior="cycle"
|
|
66
|
-
android:indeterminateOnly="true"/>
|
|
67
|
-
</FrameLayout>
|
|
68
|
-
</FrameLayout>
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<FrameLayout
|
|
3
|
+
android:layout_width="match_parent"
|
|
4
|
+
android:layout_height="match_parent"
|
|
5
|
+
tools:context="com.ahm.capacitor.camera.preview.CameraActivity"
|
|
6
|
+
android:id="@+id/frame_container"
|
|
7
|
+
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
8
|
+
xmlns:tools="http://schemas.android.com/tools"
|
|
9
|
+
android:layout_gravity="center_horizontal|top"
|
|
10
|
+
android:layout_weight=".7">
|
|
11
|
+
|
|
12
|
+
<RelativeLayout
|
|
13
|
+
android:layout_width="match_parent"
|
|
14
|
+
android:layout_height="match_parent"
|
|
15
|
+
android:gravity="center_horizontal|top"
|
|
16
|
+
android:id="@+id/frame_camera_cont"
|
|
17
|
+
android:layout_gravity="center_horizontal|top">
|
|
18
|
+
|
|
19
|
+
<FrameLayout
|
|
20
|
+
android:layout_width="match_parent"
|
|
21
|
+
android:layout_height="match_parent"
|
|
22
|
+
android:id="@+id/video_view"
|
|
23
|
+
|
|
24
|
+
android:scaleType="fitXY"
|
|
25
|
+
android:layout_gravity="top" />
|
|
26
|
+
|
|
27
|
+
<ImageView
|
|
28
|
+
android:layout_width="match_parent"
|
|
29
|
+
android:layout_height="match_parent"
|
|
30
|
+
android:id="@+id/picture_view"
|
|
31
|
+
android:layout_gravity="center|bottom"
|
|
32
|
+
android:adjustViewBounds="true"
|
|
33
|
+
android:scaleType="fitXY" />
|
|
34
|
+
|
|
35
|
+
<ImageView
|
|
36
|
+
android:layout_width="match_parent"
|
|
37
|
+
android:layout_height="match_parent"
|
|
38
|
+
android:id="@+id/frame_view"
|
|
39
|
+
android:layout_gravity="center_horizontal|bottom"
|
|
40
|
+
android:adjustViewBounds="true"
|
|
41
|
+
android:scaleType="centerInside" />
|
|
42
|
+
|
|
43
|
+
</RelativeLayout>
|
|
44
|
+
|
|
45
|
+
<FrameLayout
|
|
46
|
+
android:layout_width="match_parent"
|
|
47
|
+
android:layout_height="match_parent"
|
|
48
|
+
android:id="@+id/camera_loader"
|
|
49
|
+
android:scaleType="fitXY"
|
|
50
|
+
android:layout_gravity="top"
|
|
51
|
+
android:layout_alignWithParentIfMissing="false"
|
|
52
|
+
android:layout_alignParentTop="false"
|
|
53
|
+
android:layout_alignParentLeft="false"
|
|
54
|
+
android:layout_alignParentBottom="false"
|
|
55
|
+
android:layout_alignParentRight="false"
|
|
56
|
+
android:visibility="invisible"
|
|
57
|
+
android:background="#ff000000">
|
|
58
|
+
|
|
59
|
+
<ProgressBar
|
|
60
|
+
android:layout_width="wrap_content"
|
|
61
|
+
android:layout_height="wrap_content"
|
|
62
|
+
android:id="@+id/camera_loader_spinner"
|
|
63
|
+
android:layout_gravity="center"
|
|
64
|
+
android:indeterminate="false"
|
|
65
|
+
android:indeterminateBehavior="cycle"
|
|
66
|
+
android:indeterminateOnly="true"/>
|
|
67
|
+
</FrameLayout>
|
|
68
|
+
</FrameLayout>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
-
<resources>
|
|
3
|
-
<item type="id" name="camera_container" />
|
|
4
|
-
</resources>
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<resources>
|
|
3
|
+
<item type="id" name="camera_container" />
|
|
4
|
+
</resources>
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
-
<resources>
|
|
3
|
-
<style name="CameraPreviewTheme" parent="android:Theme.Light">
|
|
4
|
-
<item name="android:windowIsFloating">true</item>
|
|
5
|
-
<item name="android:windowCloseOnTouchOutside">false</item>
|
|
6
|
-
<item name="android:colorBackgroundCacheHint">@null</item>
|
|
7
|
-
<item name="android:backgroundDimEnabled">false</item>
|
|
8
|
-
</style>
|
|
9
|
-
</resources>
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<resources>
|
|
3
|
+
<style name="CameraPreviewTheme" parent="android:Theme.Light">
|
|
4
|
+
<item name="android:windowIsFloating">true</item>
|
|
5
|
+
<item name="android:windowCloseOnTouchOutside">false</item>
|
|
6
|
+
<item name="android:colorBackgroundCacheHint">@null</item>
|
|
7
|
+
<item name="android:backgroundDimEnabled">false</item>
|
|
8
|
+
</style>
|
|
9
|
+
</resources>
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
-
<resources>
|
|
3
|
-
</resources>
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<resources>
|
|
3
|
+
</resources>
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
<resources>
|
|
2
|
-
<string name="my_string">Just a simple string</string>
|
|
3
|
-
</resources>
|
|
1
|
+
<resources>
|
|
2
|
+
<string name="my_string">Just a simple string</string>
|
|
3
|
+
</resources>
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
<resources>
|
|
2
|
-
|
|
3
|
-
</resources>
|
|
1
|
+
<resources>
|
|
2
|
+
|
|
3
|
+
</resources>
|
package/dist/docs.json
CHANGED
|
@@ -109,6 +109,16 @@
|
|
|
109
109
|
"complexTypes": [],
|
|
110
110
|
"slug": "flip"
|
|
111
111
|
},
|
|
112
|
+
{
|
|
113
|
+
"name": "changeOrientation",
|
|
114
|
+
"signature": "() => Promise<void>",
|
|
115
|
+
"parameters": [],
|
|
116
|
+
"returns": "Promise<void>",
|
|
117
|
+
"tags": [],
|
|
118
|
+
"docs": "",
|
|
119
|
+
"complexTypes": [],
|
|
120
|
+
"slug": "changeorientation"
|
|
121
|
+
},
|
|
112
122
|
{
|
|
113
123
|
"name": "setOpacity",
|
|
114
124
|
"signature": "(options: CameraOpacityOptions) => Promise<{}>",
|
|
@@ -320,7 +330,7 @@
|
|
|
320
330
|
{
|
|
321
331
|
"name": "quality",
|
|
322
332
|
"tags": [],
|
|
323
|
-
"docs": "The picture quality, 0 - 100, default 85 on `iOS/Android`.\
|
|
333
|
+
"docs": "The picture quality, 0 - 100, default 85 on `iOS/Android`.\n\nIf left undefined, the `web` implementation will export a PNG, otherwise a JPEG will be generated",
|
|
324
334
|
"complexTypes": [],
|
|
325
335
|
"type": "number | undefined"
|
|
326
336
|
}
|
|
@@ -1,80 +1,81 @@
|
|
|
1
|
-
export declare type CameraPosition = 'rear' | 'front';
|
|
2
|
-
export interface CameraPreviewOptions {
|
|
3
|
-
/** Parent element to attach the video preview element to (applicable to the web platform only) */
|
|
4
|
-
parent?: string;
|
|
5
|
-
/** Class name to add to the video preview element (applicable to the web platform only) */
|
|
6
|
-
className?: string;
|
|
7
|
-
/** The preview width in pixels, default window.screen.width */
|
|
8
|
-
width?: number;
|
|
9
|
-
/** The preview height in pixels, default window.screen.height */
|
|
10
|
-
height?: number;
|
|
11
|
-
/** The x origin, default 0 (applicable to the android and ios platforms only) */
|
|
12
|
-
x?: number;
|
|
13
|
-
/** The y origin, default 0 (applicable to the android and ios platforms only) */
|
|
14
|
-
y?: number;
|
|
15
|
-
/** Brings your html in front of your preview, default false (applicable to the android only) */
|
|
16
|
-
toBack?: boolean;
|
|
17
|
-
/** The preview bottom padding in pixes. Useful to keep the appropriate preview sizes when orientation changes (applicable to the android and ios platforms only) */
|
|
18
|
-
paddingBottom?: number;
|
|
19
|
-
/** Rotate preview when orientation changes (applicable to the ios platforms only; default value is true) */
|
|
20
|
-
rotateWhenOrientationChanged?: boolean;
|
|
21
|
-
/** Choose the camera to use 'front' or 'rear', default 'front' */
|
|
22
|
-
position?: CameraPosition | string;
|
|
23
|
-
/** Defaults to false - Capture images to a file and return the file path instead of returning base64 encoded data */
|
|
24
|
-
storeToFile?: boolean;
|
|
25
|
-
/** 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) */
|
|
26
|
-
disableExifHeaderStripping?: boolean;
|
|
27
|
-
/** Defaults to false - iOS only - Activate high resolution image capture so that output images are from the highest resolution possible on the device **/
|
|
28
|
-
enableHighResolution?: boolean;
|
|
29
|
-
/** Defaults to false - Web only - Disables audio stream to prevent permission requests and output switching */
|
|
30
|
-
disableAudio?: boolean;
|
|
31
|
-
/** Android Only - Locks device orientation when camera is showing. */
|
|
32
|
-
lockAndroidOrientation?: boolean;
|
|
33
|
-
/** Defaults to false - Android and Web only. Set if camera preview can change opacity. */
|
|
34
|
-
enableOpacity?: boolean;
|
|
35
|
-
/** Defaults to false - Android only. Set if camera preview will support pinch to zoom. */
|
|
36
|
-
enableZoom?: boolean;
|
|
37
|
-
/** override defualt lens choice ios String 'ultra','wide','tele' android int example 100, 200 etc */
|
|
38
|
-
zoomFactor?: any;
|
|
39
|
-
}
|
|
40
|
-
export interface CameraPreviewPictureOptions {
|
|
41
|
-
/** The picture height, optional, default 0 (Device default) */
|
|
42
|
-
height?: number;
|
|
43
|
-
/** The picture width, optional, default 0 (Device default) */
|
|
44
|
-
width?: number;
|
|
45
|
-
/** The picture quality, 0 - 100, default 85 on `iOS/Android`.
|
|
46
|
-
*
|
|
47
|
-
* If left undefined, the `web` implementation will export a PNG, otherwise a JPEG will be generated */
|
|
48
|
-
quality?: number;
|
|
49
|
-
}
|
|
50
|
-
export interface CameraSampleOptions {
|
|
51
|
-
/** The picture quality, 0 - 100, default 85 */
|
|
52
|
-
quality?: number;
|
|
53
|
-
}
|
|
54
|
-
export declare type CameraPreviewFlashMode = 'off' | 'on' | 'auto' | 'red-eye' | 'torch';
|
|
55
|
-
export interface CameraOpacityOptions {
|
|
56
|
-
/** The percent opacity to set for camera view, default 1 */
|
|
57
|
-
opacity?: number;
|
|
58
|
-
}
|
|
59
|
-
export interface CameraPreviewPlugin {
|
|
60
|
-
start(options: CameraPreviewOptions): Promise<{}>;
|
|
61
|
-
stop(): Promise<{}>;
|
|
62
|
-
capture(options: CameraPreviewPictureOptions): Promise<{
|
|
63
|
-
value: string;
|
|
64
|
-
}>;
|
|
65
|
-
captureSample(options: CameraSampleOptions): Promise<{
|
|
66
|
-
value: string;
|
|
67
|
-
}>;
|
|
68
|
-
getSupportedFlashModes(): Promise<{
|
|
69
|
-
result: CameraPreviewFlashMode[];
|
|
70
|
-
}>;
|
|
71
|
-
setFlashMode(options: {
|
|
72
|
-
flashMode: CameraPreviewFlashMode | string;
|
|
73
|
-
}): Promise<void>;
|
|
74
|
-
flip(): Promise<void>;
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
}
|
|
1
|
+
export declare type CameraPosition = 'rear' | 'front';
|
|
2
|
+
export interface CameraPreviewOptions {
|
|
3
|
+
/** Parent element to attach the video preview element to (applicable to the web platform only) */
|
|
4
|
+
parent?: string;
|
|
5
|
+
/** Class name to add to the video preview element (applicable to the web platform only) */
|
|
6
|
+
className?: string;
|
|
7
|
+
/** The preview width in pixels, default window.screen.width */
|
|
8
|
+
width?: number;
|
|
9
|
+
/** The preview height in pixels, default window.screen.height */
|
|
10
|
+
height?: number;
|
|
11
|
+
/** The x origin, default 0 (applicable to the android and ios platforms only) */
|
|
12
|
+
x?: number;
|
|
13
|
+
/** The y origin, default 0 (applicable to the android and ios platforms only) */
|
|
14
|
+
y?: number;
|
|
15
|
+
/** Brings your html in front of your preview, default false (applicable to the android only) */
|
|
16
|
+
toBack?: boolean;
|
|
17
|
+
/** The preview bottom padding in pixes. Useful to keep the appropriate preview sizes when orientation changes (applicable to the android and ios platforms only) */
|
|
18
|
+
paddingBottom?: number;
|
|
19
|
+
/** Rotate preview when orientation changes (applicable to the ios platforms only; default value is true) */
|
|
20
|
+
rotateWhenOrientationChanged?: boolean;
|
|
21
|
+
/** Choose the camera to use 'front' or 'rear', default 'front' */
|
|
22
|
+
position?: CameraPosition | string;
|
|
23
|
+
/** Defaults to false - Capture images to a file and return the file path instead of returning base64 encoded data */
|
|
24
|
+
storeToFile?: boolean;
|
|
25
|
+
/** 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) */
|
|
26
|
+
disableExifHeaderStripping?: boolean;
|
|
27
|
+
/** Defaults to false - iOS only - Activate high resolution image capture so that output images are from the highest resolution possible on the device **/
|
|
28
|
+
enableHighResolution?: boolean;
|
|
29
|
+
/** Defaults to false - Web only - Disables audio stream to prevent permission requests and output switching */
|
|
30
|
+
disableAudio?: boolean;
|
|
31
|
+
/** Android Only - Locks device orientation when camera is showing. */
|
|
32
|
+
lockAndroidOrientation?: boolean;
|
|
33
|
+
/** Defaults to false - Android and Web only. Set if camera preview can change opacity. */
|
|
34
|
+
enableOpacity?: boolean;
|
|
35
|
+
/** Defaults to false - Android only. Set if camera preview will support pinch to zoom. */
|
|
36
|
+
enableZoom?: boolean;
|
|
37
|
+
/** override defualt lens choice ios String 'ultra','wide','tele' android int example 100, 200 etc */
|
|
38
|
+
zoomFactor?: any;
|
|
39
|
+
}
|
|
40
|
+
export interface CameraPreviewPictureOptions {
|
|
41
|
+
/** The picture height, optional, default 0 (Device default) */
|
|
42
|
+
height?: number;
|
|
43
|
+
/** The picture width, optional, default 0 (Device default) */
|
|
44
|
+
width?: number;
|
|
45
|
+
/** The picture quality, 0 - 100, default 85 on `iOS/Android`.
|
|
46
|
+
*
|
|
47
|
+
* If left undefined, the `web` implementation will export a PNG, otherwise a JPEG will be generated */
|
|
48
|
+
quality?: number;
|
|
49
|
+
}
|
|
50
|
+
export interface CameraSampleOptions {
|
|
51
|
+
/** The picture quality, 0 - 100, default 85 */
|
|
52
|
+
quality?: number;
|
|
53
|
+
}
|
|
54
|
+
export declare type CameraPreviewFlashMode = 'off' | 'on' | 'auto' | 'red-eye' | 'torch';
|
|
55
|
+
export interface CameraOpacityOptions {
|
|
56
|
+
/** The percent opacity to set for camera view, default 1 */
|
|
57
|
+
opacity?: number;
|
|
58
|
+
}
|
|
59
|
+
export interface CameraPreviewPlugin {
|
|
60
|
+
start(options: CameraPreviewOptions): Promise<{}>;
|
|
61
|
+
stop(): Promise<{}>;
|
|
62
|
+
capture(options: CameraPreviewPictureOptions): Promise<{
|
|
63
|
+
value: string;
|
|
64
|
+
}>;
|
|
65
|
+
captureSample(options: CameraSampleOptions): Promise<{
|
|
66
|
+
value: string;
|
|
67
|
+
}>;
|
|
68
|
+
getSupportedFlashModes(): Promise<{
|
|
69
|
+
result: CameraPreviewFlashMode[];
|
|
70
|
+
}>;
|
|
71
|
+
setFlashMode(options: {
|
|
72
|
+
flashMode: CameraPreviewFlashMode | string;
|
|
73
|
+
}): Promise<void>;
|
|
74
|
+
flip(): Promise<void>;
|
|
75
|
+
changeOrientation(): Promise<void>;
|
|
76
|
+
setOpacity(options: CameraOpacityOptions): Promise<{}>;
|
|
77
|
+
setZoom(options: CameraPreviewOptions): Promise<void>;
|
|
78
|
+
getSupportedZoomLevels(): Promise<{
|
|
79
|
+
result: any[];
|
|
80
|
+
}>;
|
|
81
|
+
}
|
package/dist/esm/definitions.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
|
2
2
|
//# sourceMappingURL=definitions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["/* eslint-disable @typescript-eslint/ban-types */\
|
|
1
|
+
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["/* eslint-disable @typescript-eslint/ban-types */\nexport type CameraPosition = 'rear' | 'front';\nexport interface CameraPreviewOptions {\n /** Parent element to attach the video preview element to (applicable to the web platform only) */\n parent?: string;\n /** Class name to add to the video preview element (applicable to the web platform only) */\n className?: string;\n /** The preview width in pixels, default window.screen.width */\n width?: number;\n /** The preview height in pixels, default window.screen.height */\n height?: number;\n /** The x origin, default 0 (applicable to the android and ios platforms only) */\n x?: number;\n /** The y origin, default 0 (applicable to the android and ios platforms only) */\n y?: number;\n /** Brings your html in front of your preview, default false (applicable to the android only) */\n toBack?: boolean;\n /** The preview bottom padding in pixes. Useful to keep the appropriate preview sizes when orientation changes (applicable to the android and ios platforms only) */\n paddingBottom?: number;\n /** Rotate preview when orientation changes (applicable to the ios platforms only; default value is true) */\n rotateWhenOrientationChanged?: boolean;\n /** Choose the camera to use 'front' or 'rear', default 'front' */\n position?: CameraPosition | string;\n /** Defaults to false - Capture images to a file and return the file path instead of returning base64 encoded data */\n storeToFile?: boolean;\n /** 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) */\n disableExifHeaderStripping?: boolean;\n /** Defaults to false - iOS only - Activate high resolution image capture so that output images are from the highest resolution possible on the device **/\n enableHighResolution?: boolean;\n /** Defaults to false - Web only - Disables audio stream to prevent permission requests and output switching */\n disableAudio?: boolean;\n /** Android Only - Locks device orientation when camera is showing. */\n lockAndroidOrientation?: boolean;\n /** Defaults to false - Android and Web only. Set if camera preview can change opacity. */\n enableOpacity?: boolean;\n /** Defaults to false - Android only. Set if camera preview will support pinch to zoom. */\n enableZoom?: boolean;\n /** override defualt lens choice ios String 'ultra','wide','tele' android int example 100, 200 etc */\n zoomFactor?: any;\n}\nexport interface CameraPreviewPictureOptions {\n /** The picture height, optional, default 0 (Device default) */\n height?: number;\n /** The picture width, optional, default 0 (Device default) */\n width?: number;\n /** The picture quality, 0 - 100, default 85 on `iOS/Android`.\n *\n * If left undefined, the `web` implementation will export a PNG, otherwise a JPEG will be generated */\n quality?: number;\n}\n\nexport interface CameraSampleOptions {\n /** The picture quality, 0 - 100, default 85 */\n quality?: number;\n}\n\nexport type CameraPreviewFlashMode = 'off' | 'on' | 'auto' | 'red-eye' | 'torch';\n\nexport interface CameraOpacityOptions {\n /** The percent opacity to set for camera view, default 1 */\n opacity?: number;\n}\n\nexport interface CameraPreviewPlugin {\n start(options: CameraPreviewOptions): Promise<{}>;\n stop(): Promise<{}>;\n capture(options: CameraPreviewPictureOptions): Promise<{ value: string }>;\n captureSample(options: CameraSampleOptions): Promise<{ value: string }>;\n getSupportedFlashModes(): Promise<{\n result: CameraPreviewFlashMode[];\n }>;\n setFlashMode(options: { flashMode: CameraPreviewFlashMode | string }): Promise<void>;\n flip(): Promise<void>;\n changeOrientation(): Promise<void>;\n setOpacity(options: CameraOpacityOptions): Promise<{}>;\n setZoom(options: CameraPreviewOptions): Promise<void>;\n getSupportedZoomLevels(): Promise<{\n result: any[];\n }>;\n}"]}
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CameraPreviewPlugin } from './definitions';
|
|
2
|
-
declare const CameraPreview: CameraPreviewPlugin;
|
|
3
|
-
export * from './definitions';
|
|
4
|
-
export { CameraPreview };
|
|
1
|
+
import type { CameraPreviewPlugin } from './definitions';
|
|
2
|
+
declare const CameraPreview: CameraPreviewPlugin;
|
|
3
|
+
export * from './definitions';
|
|
4
|
+
export { CameraPreview };
|
package/dist/esm/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { registerPlugin } from '@capacitor/core';
|
|
2
|
-
const CameraPreview = registerPlugin('CameraPreview', {
|
|
3
|
-
web: () => import('./web').then((m) => new m.CameraPreviewWeb()),
|
|
4
|
-
});
|
|
5
|
-
export * from './definitions';
|
|
6
|
-
export { CameraPreview };
|
|
1
|
+
import { registerPlugin } from '@capacitor/core';
|
|
2
|
+
const CameraPreview = registerPlugin('CameraPreview', {
|
|
3
|
+
web: () => import('./web').then((m) => new m.CameraPreviewWeb()),
|
|
4
|
+
});
|
|
5
|
+
export * from './definitions';
|
|
6
|
+
export { CameraPreview };
|
|
7
7
|
//# sourceMappingURL=index.js.map
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAIjD,MAAM,aAAa,GAAG,cAAc,CAAsB,eAAe,EAAE;IACzE,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,gBAAgB,EAAE,CAAC;CACjE,CAAC,CAAC;AAEH,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,aAAa,EAAE,CAAC","sourcesContent":["import { registerPlugin } from '@capacitor/core';\
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAIjD,MAAM,aAAa,GAAG,cAAc,CAAsB,eAAe,EAAE;IACzE,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,gBAAgB,EAAE,CAAC;CACjE,CAAC,CAAC;AAEH,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,aAAa,EAAE,CAAC","sourcesContent":["import { registerPlugin } from '@capacitor/core';\n\nimport type { CameraPreviewPlugin } from './definitions';\n\nconst CameraPreview = registerPlugin<CameraPreviewPlugin>('CameraPreview', {\n web: () => import('./web').then((m) => new m.CameraPreviewWeb()),\n});\n\nexport * from './definitions';\nexport { CameraPreview };"]}
|
package/dist/esm/web.d.ts
CHANGED
|
@@ -1,28 +1,29 @@
|
|
|
1
|
-
import { WebPlugin } from '@capacitor/core';
|
|
2
|
-
import type { CameraPreviewOptions, CameraPreviewPictureOptions, CameraPreviewPlugin, CameraPreviewFlashMode, CameraSampleOptions, CameraOpacityOptions } from './definitions';
|
|
3
|
-
export declare class CameraPreviewWeb extends WebPlugin implements CameraPreviewPlugin {
|
|
4
|
-
/**
|
|
5
|
-
* track which camera is used based on start options
|
|
6
|
-
* used in capture
|
|
7
|
-
*/
|
|
8
|
-
private isBackCamera;
|
|
9
|
-
constructor();
|
|
10
|
-
start(options: CameraPreviewOptions): Promise<{}>;
|
|
11
|
-
stop(): Promise<any>;
|
|
12
|
-
capture(options: CameraPreviewPictureOptions): Promise<any>;
|
|
13
|
-
captureSample(_options: CameraSampleOptions): Promise<any>;
|
|
14
|
-
setZoom(_options: CameraPreviewOptions): Promise<void>;
|
|
15
|
-
getSupportedFlashModes(): Promise<{
|
|
16
|
-
result: CameraPreviewFlashMode[];
|
|
17
|
-
}>;
|
|
18
|
-
getSupportedZoomLevels(): Promise<{
|
|
19
|
-
result: any[];
|
|
20
|
-
}>;
|
|
21
|
-
setFlashMode(_options: {
|
|
22
|
-
flashMode: CameraPreviewFlashMode | string;
|
|
23
|
-
}): Promise<void>;
|
|
24
|
-
flip(): Promise<void>;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
1
|
+
import { WebPlugin } from '@capacitor/core';
|
|
2
|
+
import type { CameraPreviewOptions, CameraPreviewPictureOptions, CameraPreviewPlugin, CameraPreviewFlashMode, CameraSampleOptions, CameraOpacityOptions } from './definitions';
|
|
3
|
+
export declare class CameraPreviewWeb extends WebPlugin implements CameraPreviewPlugin {
|
|
4
|
+
/**
|
|
5
|
+
* track which camera is used based on start options
|
|
6
|
+
* used in capture
|
|
7
|
+
*/
|
|
8
|
+
private isBackCamera;
|
|
9
|
+
constructor();
|
|
10
|
+
start(options: CameraPreviewOptions): Promise<{}>;
|
|
11
|
+
stop(): Promise<any>;
|
|
12
|
+
capture(options: CameraPreviewPictureOptions): Promise<any>;
|
|
13
|
+
captureSample(_options: CameraSampleOptions): Promise<any>;
|
|
14
|
+
setZoom(_options: CameraPreviewOptions): Promise<void>;
|
|
15
|
+
getSupportedFlashModes(): Promise<{
|
|
16
|
+
result: CameraPreviewFlashMode[];
|
|
17
|
+
}>;
|
|
18
|
+
getSupportedZoomLevels(): Promise<{
|
|
19
|
+
result: any[];
|
|
20
|
+
}>;
|
|
21
|
+
setFlashMode(_options: {
|
|
22
|
+
flashMode: CameraPreviewFlashMode | string;
|
|
23
|
+
}): Promise<void>;
|
|
24
|
+
flip(): Promise<void>;
|
|
25
|
+
changeOrientation(): Promise<void>;
|
|
26
|
+
setOpacity(_options: CameraOpacityOptions): Promise<any>;
|
|
27
|
+
}
|
|
28
|
+
declare const CameraPreview: CameraPreviewWeb;
|
|
29
|
+
export { CameraPreview };
|