@capgo/camera-preview 6.0.7 → 6.1.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.
@@ -11,7 +11,7 @@ buildscript {
11
11
  google()
12
12
  }
13
13
  dependencies {
14
- classpath 'com.android.tools.build:gradle:8.0.0'
14
+ classpath 'com.android.tools.build:gradle:8.2.1'
15
15
  }
16
16
  }
17
17
 
@@ -19,10 +19,10 @@ apply plugin: 'com.android.library'
19
19
 
20
20
  android {
21
21
  namespace "com.ahm.capacitor.camera.preview.capacitorcamerapreview"
22
- compileSdkVersion project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 33
22
+ compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 34
23
23
  defaultConfig {
24
24
  minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 22
25
- targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 33
25
+ targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 34
26
26
  versionCode 1
27
27
  versionName "1.0"
28
28
  testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
@@ -1,6 +1,7 @@
1
1
  distributionBase=GRADLE_USER_HOME
2
2
  distributionPath=wrapper/dists
3
- distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-all.zip
3
+ distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-all.zip
4
4
  networkTimeout=10000
5
+ validateDistributionUrl=true
5
6
  zipStoreBase=GRADLE_USER_HOME
6
7
  zipStorePath=wrapper/dists
package/android/gradlew CHANGED
@@ -85,9 +85,6 @@ done
85
85
  APP_BASE_NAME=${0##*/}
86
86
  APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
87
87
 
88
- # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
89
- DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
90
-
91
88
  # Use the maximum available, or set MAX_FD != -1 to use that value.
92
89
  MAX_FD=maximum
93
90
 
@@ -133,10 +130,13 @@ location of your Java installation."
133
130
  fi
134
131
  else
135
132
  JAVACMD=java
136
- which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
133
+ if ! command -v java >/dev/null 2>&1
134
+ then
135
+ die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
137
136
 
138
137
  Please set the JAVA_HOME variable in your environment to match the
139
138
  location of your Java installation."
139
+ fi
140
140
  fi
141
141
 
142
142
  # Increase the maximum file descriptors if we can.
@@ -197,6 +197,10 @@ if "$cygwin" || "$msys" ; then
197
197
  done
198
198
  fi
199
199
 
200
+
201
+ # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
202
+ DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
203
+
200
204
  # Collect all arguments for the java command;
201
205
  # * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
202
206
  # shell script including quotes and variable substitutions, so put them in
@@ -87,7 +87,6 @@ public class CameraActivity extends Fragment {
87
87
  private RecordingState mRecordingState = RecordingState.INITIALIZING;
88
88
  private MediaRecorder mRecorder = null;
89
89
  private String recordFilePath;
90
- private float opacity;
91
90
 
92
91
  // The first rear facing camera
93
92
  private int defaultCameraId;
@@ -121,13 +120,12 @@ public class CameraActivity extends Fragment {
121
120
  appResourcesPackage = getActivity().getPackageName();
122
121
 
123
122
  // Inflate the layout for this fragment
124
- view =
125
- inflater.inflate(
126
- getResources()
127
- .getIdentifier("camera_activity", "layout", appResourcesPackage),
128
- container,
129
- false
130
- );
123
+ view = inflater.inflate(
124
+ getResources()
125
+ .getIdentifier("camera_activity", "layout", appResourcesPackage),
126
+ container,
127
+ false
128
+ );
131
129
  createCameraPreview();
132
130
  return view;
133
131
  }
@@ -149,19 +147,17 @@ public class CameraActivity extends Fragment {
149
147
  height
150
148
  );
151
149
  layoutParams.setMargins(x, y, 0, 0);
152
- frameContainerLayout =
153
- (FrameLayout) view.findViewById(
154
- getResources()
155
- .getIdentifier("frame_container", "id", appResourcesPackage)
156
- );
150
+ frameContainerLayout = (FrameLayout) view.findViewById(
151
+ getResources()
152
+ .getIdentifier("frame_container", "id", appResourcesPackage)
153
+ );
157
154
  frameContainerLayout.setLayoutParams(layoutParams);
158
155
 
159
156
  //video view
160
157
  mPreview = new Preview(getActivity(), enableOpacity);
161
- mainLayout =
162
- (FrameLayout) view.findViewById(
163
- getResources().getIdentifier("video_view", "id", appResourcesPackage)
164
- );
158
+ mainLayout = (FrameLayout) view.findViewById(
159
+ getResources().getIdentifier("video_view", "id", appResourcesPackage)
160
+ );
165
161
  mainLayout.setLayoutParams(
166
162
  new RelativeLayout.LayoutParams(
167
163
  RelativeLayout.LayoutParams.MATCH_PARENT,
@@ -280,10 +276,10 @@ public class CameraActivity extends Fragment {
280
276
  switch (event.getAction()) {
281
277
  case MotionEvent.ACTION_DOWN:
282
278
  if (mLastTouchX == 0 || mLastTouchY == 0) {
283
- mLastTouchX =
284
- (int) event.getRawX() - layoutParams.leftMargin;
285
- mLastTouchY =
286
- (int) event.getRawY() - layoutParams.topMargin;
279
+ mLastTouchX = (int) event.getRawX() -
280
+ layoutParams.leftMargin;
281
+ mLastTouchY = (int) event.getRawY() -
282
+ layoutParams.topMargin;
287
283
  } else {
288
284
  mLastTouchX = (int) event.getRawX();
289
285
  mLastTouchY = (int) event.getRawY();
@@ -363,17 +359,22 @@ public class CameraActivity extends Fragment {
363
359
  );
364
360
  }
365
361
 
366
- private void setDefaultCameraId() {
367
- // Find the total number of cameras available
368
- numberOfCameras = Camera.getNumberOfCameras();
362
+ private int getNumberOfCameras() {
363
+ if (numberOfCameras == 0) {
364
+ numberOfCameras = Camera.getNumberOfCameras();
365
+ }
366
+
367
+ return numberOfCameras;
368
+ }
369
369
 
370
+ private void setDefaultCameraId() {
370
371
  int facing = "front".equals(defaultCamera)
371
372
  ? Camera.CameraInfo.CAMERA_FACING_FRONT
372
373
  : Camera.CameraInfo.CAMERA_FACING_BACK;
373
374
 
374
375
  // Find the ID of the default camera
375
376
  Camera.CameraInfo cameraInfo = new Camera.CameraInfo();
376
- for (int i = 0; i < numberOfCameras; i++) {
377
+ for (int i = 0; i < getNumberOfCameras(); i++) {
377
378
  Camera.getCameraInfo(i, cameraInfo);
378
379
  if (cameraInfo.facing == facing) {
379
380
  defaultCameraId = i;
@@ -384,16 +385,17 @@ public class CameraActivity extends Fragment {
384
385
 
385
386
  @Override
386
387
  public void onResume() {
388
+ // This gets called when getting started AND after the app gets resumed.
387
389
  super.onResume();
388
390
 
389
- mCamera = Camera.open(defaultCameraId);
391
+ // Make sure that we load the currently "locked" camera. If the camera gets changed
392
+ // during use, we want to "restore" that camera back as soon as we come back to the app.
393
+ mCamera = Camera.open(cameraCurrentlyLocked);
390
394
 
391
- if (cameraParameters != null) {
395
+ if (cameraCurrentlyLocked == 0 && cameraParameters != null) {
392
396
  mCamera.setParameters(cameraParameters);
393
397
  }
394
398
 
395
- cameraCurrentlyLocked = defaultCameraId;
396
-
397
399
  if (mPreview.mPreviewSize == null) {
398
400
  mPreview.setCamera(mCamera, cameraCurrentlyLocked);
399
401
  eventListener.onCameraStarted();
@@ -440,8 +442,8 @@ public class CameraActivity extends Fragment {
440
442
  frameContainerLayout.getWidth(),
441
443
  frameContainerLayout.getHeight()
442
444
  );
443
- camViewLayout.gravity =
444
- Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL;
445
+ camViewLayout.gravity = Gravity.CENTER_HORIZONTAL |
446
+ Gravity.CENTER_VERTICAL;
445
447
  frameCamContainerLayout.setLayoutParams(camViewLayout);
446
448
  }
447
449
  }
@@ -512,7 +514,7 @@ public class CameraActivity extends Fragment {
512
514
  if (numberOfCameras == 1) {
513
515
  //There is only one camera available
514
516
  } else {
515
- Log.d(TAG, "numberOfCameras: " + numberOfCameras);
517
+ Log.d(TAG, "numberOfCameras: " + getNumberOfCameras());
516
518
 
517
519
  // OK, we have multiple cameras. Release this camera -> cameraCurrentlyLocked
518
520
  if (mCamera != null) {
@@ -527,7 +529,8 @@ public class CameraActivity extends Fragment {
527
529
  "cameraCurrentlyLocked := " + Integer.toString(cameraCurrentlyLocked)
528
530
  );
529
531
  try {
530
- cameraCurrentlyLocked = (cameraCurrentlyLocked + 1) % numberOfCameras;
532
+ cameraCurrentlyLocked = (cameraCurrentlyLocked + 1) %
533
+ getNumberOfCameras();
531
534
  Log.d(TAG, "cameraCurrentlyLocked new: " + cameraCurrentlyLocked);
532
535
  } catch (Exception exception) {
533
536
  Log.d(TAG, exception.getMessage());
@@ -720,8 +723,8 @@ public class CameraActivity extends Fragment {
720
723
 
721
724
  Camera.Size requestedSize = mCamera.new Size(size.width, size.height);
722
725
 
723
- double previewAspectRatio = (double) previewSize.width /
724
- (double) previewSize.height;
726
+ double previewAspectRatio =
727
+ (double) previewSize.width / (double) previewSize.height;
725
728
 
726
729
  if (previewAspectRatio < 1.0) {
727
730
  // reset ratio to landscape
@@ -841,7 +844,6 @@ public class CameraActivity extends Fragment {
841
844
 
842
845
  public void setOpacity(final float opacity) {
843
846
  Log.d(TAG, "set opacity:" + opacity);
844
- this.opacity = opacity;
845
847
  mPreview.setOpacity(opacity);
846
848
  }
847
849
 
@@ -858,13 +860,12 @@ public class CameraActivity extends Fragment {
858
860
  mPreview.getCameraFacing() ==
859
861
  Camera.CameraInfo.CAMERA_FACING_FRONT
860
862
  ) {
861
- bytes =
862
- rotateNV21(
863
- bytes,
864
- size.width,
865
- size.height,
866
- (360 - orientation) % 360
867
- );
863
+ bytes = rotateNV21(
864
+ bytes,
865
+ size.width,
866
+ size.height,
867
+ (360 - orientation) % 360
868
+ );
868
869
  } else {
869
870
  bytes = rotateNV21(bytes, size.width, size.height, orientation);
870
871
  }
@@ -1048,8 +1049,10 @@ public class CameraActivity extends Fragment {
1048
1049
  CamcorderProfile.QUALITY_HIGH
1049
1050
  )
1050
1051
  ) {
1051
- profile =
1052
- CamcorderProfile.get(defaultCameraId, CamcorderProfile.QUALITY_HIGH);
1052
+ profile = CamcorderProfile.get(
1053
+ defaultCameraId,
1054
+ CamcorderProfile.QUALITY_HIGH
1055
+ );
1053
1056
  } else {
1054
1057
  if (
1055
1058
  CamcorderProfile.hasProfile(
@@ -1057,11 +1060,10 @@ public class CameraActivity extends Fragment {
1057
1060
  CamcorderProfile.QUALITY_480P
1058
1061
  )
1059
1062
  ) {
1060
- profile =
1061
- CamcorderProfile.get(
1062
- defaultCameraId,
1063
- CamcorderProfile.QUALITY_480P
1064
- );
1063
+ profile = CamcorderProfile.get(
1064
+ defaultCameraId,
1065
+ CamcorderProfile.QUALITY_480P
1066
+ );
1065
1067
  } else {
1066
1068
  if (
1067
1069
  CamcorderProfile.hasProfile(
@@ -1069,11 +1071,10 @@ public class CameraActivity extends Fragment {
1069
1071
  CamcorderProfile.QUALITY_720P
1070
1072
  )
1071
1073
  ) {
1072
- profile =
1073
- CamcorderProfile.get(
1074
- defaultCameraId,
1075
- CamcorderProfile.QUALITY_720P
1076
- );
1074
+ profile = CamcorderProfile.get(
1075
+ defaultCameraId,
1076
+ CamcorderProfile.QUALITY_720P
1077
+ );
1077
1078
  } else {
1078
1079
  if (
1079
1080
  CamcorderProfile.hasProfile(
@@ -1081,17 +1082,15 @@ public class CameraActivity extends Fragment {
1081
1082
  CamcorderProfile.QUALITY_1080P
1082
1083
  )
1083
1084
  ) {
1084
- profile =
1085
- CamcorderProfile.get(
1086
- defaultCameraId,
1087
- CamcorderProfile.QUALITY_1080P
1088
- );
1085
+ profile = CamcorderProfile.get(
1086
+ defaultCameraId,
1087
+ CamcorderProfile.QUALITY_1080P
1088
+ );
1089
1089
  } else {
1090
- profile =
1091
- CamcorderProfile.get(
1092
- defaultCameraId,
1093
- CamcorderProfile.QUALITY_LOW
1094
- );
1090
+ profile = CamcorderProfile.get(
1091
+ defaultCameraId,
1092
+ CamcorderProfile.QUALITY_LOW
1093
+ );
1095
1094
  }
1096
1095
  }
1097
1096
  }
@@ -1177,11 +1176,9 @@ public class CameraActivity extends Fragment {
1177
1176
 
1178
1177
  public void muteStream(boolean mute, Activity activity) {
1179
1178
  AudioManager audioManager =
1180
- (
1181
- (AudioManager) activity
1179
+ ((AudioManager) activity
1182
1180
  .getApplicationContext()
1183
- .getSystemService(Context.AUDIO_SERVICE)
1184
- );
1181
+ .getSystemService(Context.AUDIO_SERVICE));
1185
1182
  int direction = mute
1186
1183
  ? audioManager.ADJUST_MUTE
1187
1184
  : audioManager.ADJUST_UNMUTE;
@@ -1232,10 +1229,10 @@ public class CameraActivity extends Fragment {
1232
1229
  y = height - 100;
1233
1230
  }
1234
1231
  return new Rect(
1235
- Math.round((x - 100) * 2000 / width - 1000),
1236
- Math.round((y - 100) * 2000 / height - 1000),
1237
- Math.round((x + 100) * 2000 / width - 1000),
1238
- Math.round((y + 100) * 2000 / height - 1000)
1232
+ Math.round(((x - 100) * 2000) / width - 1000),
1233
+ Math.round(((y - 100) * 2000) / height - 1000),
1234
+ Math.round(((x + 100) * 2000) / width - 1000),
1235
+ Math.round(((y + 100) * 2000) / height - 1000)
1239
1236
  );
1240
1237
  }
1241
1238
 
@@ -44,7 +44,7 @@ public class CameraPreview
44
44
  static final String CAMERA_PERMISSION_ALIAS = "camera";
45
45
 
46
46
  private static String VIDEO_FILE_PATH = "";
47
- private static String VIDEO_FILE_EXTENSION = ".mp4";
47
+ private static final String VIDEO_FILE_EXTENSION = ".mp4";
48
48
 
49
49
  private String captureCallbackId = "";
50
50
  private String snapshotCallbackId = "";
@@ -52,10 +52,11 @@ public class CameraPreview
52
52
  private String cameraStartCallbackId = "";
53
53
 
54
54
  // keep track of previously specified orientation to support locking orientation:
55
- private int previousOrientationRequest = -1;
55
+ private int previousOrientationRequest =
56
+ ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED;
56
57
 
57
58
  private CameraActivity fragment;
58
- private int containerViewId = 20;
59
+ private final int containerViewId = 20;
59
60
 
60
61
  @PluginMethod
61
62
  public void start(PluginCall call) {
@@ -87,7 +88,7 @@ public class CameraPreview
87
88
 
88
89
  @PluginMethod
89
90
  public void setOpacity(PluginCall call) {
90
- if (this.hasCamera(call) == false) {
91
+ if (!this.hasCamera(call)) {
91
92
  call.error("Camera is not running");
92
93
  return;
93
94
  }
@@ -99,7 +100,7 @@ public class CameraPreview
99
100
 
100
101
  @PluginMethod
101
102
  public void capture(PluginCall call) {
102
- if (this.hasCamera(call) == false) {
103
+ if (!this.hasCamera(call)) {
103
104
  call.reject("Camera is not running");
104
105
  return;
105
106
  }
@@ -115,7 +116,7 @@ public class CameraPreview
115
116
 
116
117
  @PluginMethod
117
118
  public void captureSample(PluginCall call) {
118
- if (this.hasCamera(call) == false) {
119
+ if (!this.hasCamera(call)) {
119
120
  call.reject("Camera is not running");
120
121
  return;
121
122
  }
@@ -167,7 +168,7 @@ public class CameraPreview
167
168
 
168
169
  @PluginMethod
169
170
  public void getSupportedFlashModes(PluginCall call) {
170
- if (this.hasCamera(call) == false) {
171
+ if (!this.hasCamera(call)) {
171
172
  call.reject("Camera is not running");
172
173
  return;
173
174
  }
@@ -191,7 +192,7 @@ public class CameraPreview
191
192
 
192
193
  @PluginMethod
193
194
  public void getHorizontalFov(PluginCall call) {
194
- if (this.hasCamera(call) == false) {
195
+ if (!this.hasCamera(call)) {
195
196
  call.reject("Camera is not running");
196
197
  return;
197
198
  }
@@ -208,7 +209,7 @@ public class CameraPreview
208
209
 
209
210
  @PluginMethod
210
211
  public void setFlashMode(PluginCall call) {
211
- if (this.hasCamera(call) == false) {
212
+ if (!this.hasCamera(call)) {
212
213
  call.reject("Camera is not running");
213
214
  return;
214
215
  }
@@ -240,7 +241,7 @@ public class CameraPreview
240
241
 
241
242
  @PluginMethod
242
243
  public void startRecordVideo(final PluginCall call) {
243
- if (this.hasCamera(call) == false) {
244
+ if (!this.hasCamera(call)) {
244
245
  call.reject("Camera is not running");
245
246
  return;
246
247
  }
@@ -281,7 +282,7 @@ public class CameraPreview
281
282
 
282
283
  @PluginMethod
283
284
  public void stopRecordVideo(PluginCall call) {
284
- if (this.hasCamera(call) == false) {
285
+ if (!this.hasCamera(call)) {
285
286
  call.reject("Camera is not running");
286
287
  return;
287
288
  }
@@ -346,8 +347,9 @@ public class CameraPreview
346
347
  "lockAndroidOrientation",
347
348
  false
348
349
  );
349
- previousOrientationRequest =
350
- getBridge().getActivity().getRequestedOrientation();
350
+ previousOrientationRequest = getBridge()
351
+ .getActivity()
352
+ .getRequestedOrientation();
351
353
 
352
354
  fragment = new CameraActivity();
353
355
  fragment.setEventListener(this);
@@ -398,23 +400,21 @@ public class CameraPreview
398
400
  int computedPaddingBottom;
399
401
 
400
402
  if (paddingBottom != 0) {
401
- computedPaddingBottom =
402
- (int) TypedValue.applyDimension(
403
- TypedValue.COMPLEX_UNIT_DIP,
404
- paddingBottom,
405
- metrics
406
- );
403
+ computedPaddingBottom = (int) TypedValue.applyDimension(
404
+ TypedValue.COMPLEX_UNIT_DIP,
405
+ paddingBottom,
406
+ metrics
407
+ );
407
408
  } else {
408
409
  computedPaddingBottom = 0;
409
410
  }
410
411
 
411
412
  if (width != 0) {
412
- computedWidth =
413
- (int) TypedValue.applyDimension(
414
- TypedValue.COMPLEX_UNIT_DIP,
415
- width,
416
- metrics
417
- );
413
+ computedWidth = (int) TypedValue.applyDimension(
414
+ TypedValue.COMPLEX_UNIT_DIP,
415
+ width,
416
+ metrics
417
+ );
418
418
  } else {
419
419
  Display defaultDisplay = getBridge()
420
420
  .getActivity()
@@ -423,22 +423,20 @@ public class CameraPreview
423
423
  final Point size = new Point();
424
424
  defaultDisplay.getSize(size);
425
425
 
426
- computedWidth =
427
- (int) TypedValue.applyDimension(
428
- TypedValue.COMPLEX_UNIT_PX,
429
- size.x,
430
- metrics
431
- );
426
+ computedWidth = (int) TypedValue.applyDimension(
427
+ TypedValue.COMPLEX_UNIT_PX,
428
+ size.x,
429
+ metrics
430
+ );
432
431
  }
433
432
 
434
433
  if (height != 0) {
435
- computedHeight =
436
- (int) TypedValue.applyDimension(
437
- TypedValue.COMPLEX_UNIT_DIP,
438
- height,
439
- metrics
440
- ) -
441
- computedPaddingBottom;
434
+ computedHeight = (int) TypedValue.applyDimension(
435
+ TypedValue.COMPLEX_UNIT_DIP,
436
+ height,
437
+ metrics
438
+ ) -
439
+ computedPaddingBottom;
442
440
  } else {
443
441
  Display defaultDisplay = getBridge()
444
442
  .getActivity()
@@ -447,13 +445,12 @@ public class CameraPreview
447
445
  final Point size = new Point();
448
446
  defaultDisplay.getSize(size);
449
447
 
450
- computedHeight =
451
- (int) TypedValue.applyDimension(
452
- TypedValue.COMPLEX_UNIT_PX,
453
- size.y,
454
- metrics
455
- ) -
456
- computedPaddingBottom;
448
+ computedHeight = (int) TypedValue.applyDimension(
449
+ TypedValue.COMPLEX_UNIT_PX,
450
+ size.y,
451
+ metrics
452
+ ) -
453
+ computedPaddingBottom;
457
454
  }
458
455
 
459
456
  fragment.setRect(
@@ -467,8 +464,9 @@ public class CameraPreview
467
464
  .getActivity()
468
465
  .findViewById(containerViewId);
469
466
  if (containerView == null) {
470
- containerView =
471
- new FrameLayout(getActivity().getApplicationContext());
467
+ containerView = new FrameLayout(
468
+ getActivity().getApplicationContext()
469
+ );
472
470
  containerView.setId(containerViewId);
473
471
 
474
472
  getBridge().getWebView().setBackgroundColor(Color.TRANSPARENT);
@@ -619,7 +617,11 @@ public class CameraPreview
619
617
  new View.OnTouchListener() {
620
618
  @Override
621
619
  public boolean onTouch(View v, MotionEvent event) {
622
- if ((null != fragment) && (fragment.toBack == true)) {
620
+ if (
621
+ (null != fragment) &&
622
+ (fragment.toBack == true) &&
623
+ null != fragment.frameContainerLayout
624
+ ) {
623
625
  fragment.frameContainerLayout.dispatchTouchEvent(event);
624
626
  }
625
627
  return false;
@@ -67,8 +67,9 @@ class Preview
67
67
  if (camera != null) {
68
68
  mCamera = camera;
69
69
  this.cameraId = cameraId;
70
- mSupportedPreviewSizes =
71
- mCamera.getParameters().getSupportedPreviewSizes();
70
+ mSupportedPreviewSizes = mCamera
71
+ .getParameters()
72
+ .getSupportedPreviewSizes();
72
73
  setCameraDisplayOrientation();
73
74
 
74
75
  List<String> mFocusModes = mCamera
@@ -154,9 +155,9 @@ class Preview
154
155
  Log.d(TAG, "screen is rotated " + degrees + "deg from natural");
155
156
  Log.d(
156
157
  TAG,
157
- (
158
- info.facing == Camera.CameraInfo.CAMERA_FACING_FRONT ? "front" : "back"
159
- ) +
158
+ (info.facing == Camera.CameraInfo.CAMERA_FACING_FRONT
159
+ ? "front"
160
+ : "back") +
160
161
  " camera is oriented -" +
161
162
  info.orientation +
162
163
  "deg from natural"
@@ -187,12 +188,11 @@ class Preview
187
188
  Log.d("CameraPreview", "before setPreviewSize");
188
189
 
189
190
  mSupportedPreviewSizes = parameters.getSupportedPreviewSizes();
190
- mPreviewSize =
191
- getOptimalPreviewSize(
192
- mSupportedPreviewSizes,
193
- v.getWidth(),
194
- v.getHeight()
195
- );
191
+ mPreviewSize = getOptimalPreviewSize(
192
+ mSupportedPreviewSizes,
193
+ v.getWidth(),
194
+ v.getHeight()
195
+ );
196
196
  parameters.setPreviewSize(mPreviewSize.width, mPreviewSize.height);
197
197
  Log.d(TAG, mPreviewSize.width + " " + mPreviewSize.height);
198
198
 
@@ -215,8 +215,11 @@ class Preview
215
215
  setMeasuredDimension(width, height);
216
216
 
217
217
  if (mSupportedPreviewSizes != null) {
218
- mPreviewSize =
219
- getOptimalPreviewSize(mSupportedPreviewSizes, width, height);
218
+ mPreviewSize = getOptimalPreviewSize(
219
+ mSupportedPreviewSizes,
220
+ width,
221
+ height
222
+ );
220
223
  }
221
224
  }
222
225
 
@@ -252,18 +255,18 @@ class Preview
252
255
  // Center the child SurfaceView within the parent.
253
256
  if (width * previewHeight < height * previewWidth) {
254
257
  Log.d(TAG, "center horizontally");
255
- int scaledChildWidth = (int) (
256
- (previewWidth * height / previewHeight) * scale
257
- );
258
+ int scaledChildWidth = (int) (((previewWidth * height) /
259
+ previewHeight) *
260
+ scale);
258
261
  nW = (width + scaledChildWidth) / 2;
259
262
  nH = (int) (height * scale);
260
263
  top = 0;
261
264
  left = (width - scaledChildWidth) / 2;
262
265
  } else {
263
266
  Log.d(TAG, "center vertically");
264
- int scaledChildHeight = (int) (
265
- (previewHeight * width / previewWidth) * scale
266
- );
267
+ int scaledChildHeight = (int) (((previewHeight * width) /
268
+ previewWidth) *
269
+ scale);
267
270
  nW = (int) (width * scale);
268
271
  nH = (height + scaledChildHeight) / 2;
269
272
  top = (height - scaledChildHeight) / 2;
@@ -359,8 +362,9 @@ class Preview
359
362
  try {
360
363
  // Now that the size is known, set up the camera parameters and begin
361
364
  // the preview.
362
- mSupportedPreviewSizes =
363
- mCamera.getParameters().getSupportedPreviewSizes();
365
+ mSupportedPreviewSizes = mCamera
366
+ .getParameters()
367
+ .getSupportedPreviewSizes();
364
368
  if (mSupportedPreviewSizes != null) {
365
369
  mPreviewSize = getOptimalPreviewSize(mSupportedPreviewSizes, w, h);
366
370
  }
@@ -392,8 +396,11 @@ class Preview
392
396
  try {
393
397
  mSurface = surface;
394
398
  if (mSupportedPreviewSizes != null) {
395
- mPreviewSize =
396
- getOptimalPreviewSize(mSupportedPreviewSizes, width, height);
399
+ mPreviewSize = getOptimalPreviewSize(
400
+ mSupportedPreviewSizes,
401
+ width,
402
+ height
403
+ );
397
404
  }
398
405
  if (mCamera != null) {
399
406
  mTextureView.setAlpha(opacity);
@@ -1 +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,CAAC;YACJ,IAAI,EAAE,eAAe;YACrB,SAAS,EAAE,CAAC,KAAK,CAAC;SACnB,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,KAAK,CAAC,OAA6B;;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C;IACJ,CAAC;IAED,KAAK,CAAC,gBAAgB;QAGpB,MAAM,IAAI,KAAK,CAAC,uDAAuD,CAAC,CAAC;IAC3E,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,QAElB;QACC,MAAM,IAAI,KAAK,CACb,mDAAmD,GAAG,QAAQ,CAC/D,CAAC;IACJ,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,GAAG,QAAQ,CAAC,cAAc,CAAC,OAAO,CAAqB,CAAC;QACnE,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;CACF"}
@@ -4,16 +4,6 @@ import Capacitor
4
4
 
5
5
  class PluginTests: XCTestCase {
6
6
 
7
- override func setUp() {
8
- super.setUp()
9
- // Put setup code here. This method is called before the invocation of each test method in the class.
10
- }
11
-
12
- override func tearDown() {
13
- // Put teardown code here. This method is called after the invocation of each test method in the class.
14
- super.tearDown()
15
- }
16
-
17
7
  func testEcho() {
18
8
  // This is an example of a functional test case for a plugin.
19
9
  // Use XCTAssert and related functions to verify your tests produce the correct results.
package/ios/Podfile.lock CHANGED
@@ -20,4 +20,4 @@ SPEC CHECKSUMS:
20
20
 
21
21
  PODFILE CHECKSUM: e80ffb7ef3a0ac7d0d6143f3e64f287d4d027c84
22
22
 
23
- COCOAPODS: 1.12.1
23
+ COCOAPODS: 1.15.2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capgo/camera-preview",
3
- "version": "6.0.7",
3
+ "version": "6.1.1",
4
4
  "description": "Camera preview",
5
5
  "main": "dist/esm/index.js",
6
6
  "types": "dist/esm/index.d.ts",
@@ -11,7 +11,7 @@
11
11
  "verify:web": "npm run build",
12
12
  "lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint",
13
13
  "fmt": "npm run eslint -- --fix && npm run prettier -- --write && npm run swiftlint -- --autocorrect --format",
14
- "eslint": "eslint . --ext ts",
14
+ "eslint": "eslint .",
15
15
  "prettier": "prettier --config .prettierrc.js \"**/*.{css,html,ts,js,java}\"",
16
16
  "swiftlint": "node-swiftlint",
17
17
  "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs",
@@ -24,28 +24,28 @@
24
24
  "author": "Martin Donadieu <martindonadieu@gmail.com>",
25
25
  "license": "MIT",
26
26
  "devDependencies": {
27
- "@capacitor/android": "^5.0.3",
28
- "@capacitor/cli": "^5.0.3",
29
- "@capacitor/core": "^5.0.3",
30
- "@capacitor/docgen": "^0.2.1",
31
- "@capacitor/ios": "^5.0.3",
27
+ "@capacitor/android": "^6.0.0",
28
+ "@capacitor/cli": "^6.0.0",
29
+ "@capacitor/core": "^6.0.0",
30
+ "@capacitor/docgen": "^0.2.2",
31
+ "@capacitor/ios": "^6.0.0",
32
32
  "@ionic/eslint-config": "^0.3.0",
33
- "@ionic/prettier-config": "^3.0.0",
33
+ "@ionic/prettier-config": "^4.0.0",
34
34
  "@ionic/swiftlint-config": "^1.1.2",
35
- "@typescript-eslint/eslint-plugin": "^5.59.7",
36
- "@typescript-eslint/parser": "^5.59.7",
37
- "eslint": "^8.41.0",
38
- "eslint-plugin-import": "^2.27.5",
39
- "husky": "^8.0.3",
40
- "prettier": "^2.8.8",
41
- "prettier-plugin-java": "^2.1.0",
42
- "rimraf": "^5.0.1",
43
- "rollup": "^3.23.0",
35
+ "@typescript-eslint/eslint-plugin": "^7.8.0",
36
+ "@typescript-eslint/parser": "^7.8.0",
37
+ "eslint": "^9.1.1",
38
+ "eslint-plugin-import": "^2.29.1",
39
+ "husky": "^9.0.11",
40
+ "prettier": "^3.2.5",
41
+ "prettier-plugin-java": "^2.6.0",
42
+ "rimraf": "^5.0.5",
43
+ "rollup": "^4.17.1",
44
44
  "swiftlint": "^1.0.2",
45
- "typescript": "^5.0.4"
45
+ "typescript": "^5.4.5"
46
46
  },
47
47
  "peerDependencies": {
48
- "@capacitor/core": "^5.0.0"
48
+ "@capacitor/core": "^6.0.0"
49
49
  },
50
50
  "capacitor": {
51
51
  "ios": {