@capacitor-community/camera-preview 3.0.0 → 3.1.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 CHANGED
@@ -54,11 +54,20 @@ Open `android/app/src/main/AndroidManifest.xml` and above the closing `</manifes
54
54
  For more help consult the [Capacitor docs](https://capacitorjs.com/docs/android/configuration#configuring-androidmanifestxml).
55
55
 
56
56
  ## Extra iOS installation steps
57
- 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`.
57
+ 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.
58
58
 
59
59
  ## Extra Web installation steps
60
60
  Add `import '@capacitor-community/camera-preview'` to you entry script in ionic on `app.module.ts`, so capacitor can register the web platform from the plugin
61
61
 
62
+ then in html add
63
+
64
+ <div id="cameraPreview"></div>
65
+
66
+ and
67
+ ngOnInit() { const { CameraPreview } = Plugins; CameraPreview.start({ parent: "cameraPreview"}); }
68
+
69
+ it will work
70
+
62
71
 
63
72
  # Methods
64
73
 
@@ -80,7 +89,7 @@ Starts the camera preview instance.
80
89
  | storeToFile | boolean | (optional) Capture images to a file and return back the file path instead of returning base64 encoded data, default false. |
81
90
  | 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) |
82
91
  | 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 |
83
- | disableAudio | boolean | (optional) Disables audio stream to prevent permission requests, default false. (applicable to web only) |
92
+ | disableAudio | boolean | (optional) Disables audio stream to prevent permission requests, default false. (applicable to web and iOS only) |
84
93
  | lockAndroidOrientation | boolean | (optional) Locks device orientation when camera is showing, default false. (applicable to Android only) |
85
94
  | enableOpacity | boolean | (optional) Make the camera preview see-through. Ideal for augmented reality uses. Default false (applicable to Android and web only)
86
95
  | enableZoom | boolean | (optional) Set if you can pinch to zoom. Default false (applicable to the android and ios platforms only)
@@ -1,3 +1,10 @@
1
+ ext {
2
+ junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.1'
3
+ androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.2.0'
4
+ androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.2'
5
+ androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.3.0'
6
+ }
7
+
1
8
  buildscript {
2
9
  repositories {
3
10
  mavenCentral()
@@ -11,10 +18,10 @@ buildscript {
11
18
  apply plugin: 'com.android.library'
12
19
 
13
20
  android {
14
- compileSdkVersion 30
21
+ compileSdkVersion project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 30
15
22
  defaultConfig {
16
- minSdkVersion 21
17
- targetSdkVersion 30
23
+ minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 21
24
+ targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 30
18
25
  versionCode 1
19
26
  versionName "1.0"
20
27
  testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
@@ -39,10 +46,10 @@ repositories {
39
46
  dependencies {
40
47
  implementation fileTree(dir: 'libs', include: ['*.jar'])
41
48
  implementation project(':capacitor-android')
42
- implementation 'com.android.support:appcompat-v7:28.0.0'
49
+ implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
43
50
  implementation 'androidx.exifinterface:exifinterface:1.3.2'
44
- testImplementation 'junit:junit:4.12'
45
- androidTestImplementation 'com.android.support.test:runner:1.0.2'
46
- androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
51
+ testImplementation "junit:junit:$junitVersion"
52
+ androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
53
+ androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion"
47
54
  }
48
55
 
@@ -1,14 +1,13 @@
1
1
  package com.getcapacitor.android;
2
2
 
3
+ import static org.junit.Assert.*;
4
+
3
5
  import android.content.Context;
4
6
  import android.support.test.InstrumentationRegistry;
5
7
  import android.support.test.runner.AndroidJUnit4;
6
-
7
8
  import org.junit.Test;
8
9
  import org.junit.runner.RunWith;
9
10
 
10
- import static org.junit.Assert.*;
11
-
12
11
  /**
13
12
  * Instrumented test, which will execute on an Android device.
14
13
  *
@@ -16,6 +15,7 @@ import static org.junit.Assert.*;
16
15
  */
17
16
  @RunWith(AndroidJUnit4.class)
18
17
  public class ExampleInstrumentedTest {
18
+
19
19
  @Test
20
20
  public void useAppContext() throws Exception {
21
21
  // Context of the app under test.