@capgo/camera-preview 8.3.2 → 8.3.4

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.
@@ -65,7 +65,7 @@ dependencies {
65
65
  implementation "androidx.camera:camera-lifecycle:${camerax_version}"
66
66
  implementation "androidx.camera:camera-view:${camerax_version}"
67
67
  implementation "androidx.camera:camera-extensions:${camerax_version}"
68
- implementation 'com.google.guava:guava:33.3.1-android'
68
+ implementation 'com.google.guava:guava:33.6.0-android'
69
69
 
70
70
  testImplementation "junit:junit:$junitVersion"
71
71
  androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
@@ -34,7 +34,7 @@ extension UIWindow {
34
34
  */
35
35
  @objc(CameraPreview)
36
36
  public class CameraPreview: CAPPlugin, CAPBridgedPlugin, CLLocationManagerDelegate {
37
- private let pluginVersion: String = "8.3.2"
37
+ private let pluginVersion: String = "8.3.4"
38
38
  public let identifier = "CameraPreviewPlugin"
39
39
  public let jsName = "CameraPreview"
40
40
  public let pluginMethods: [CAPPluginMethod] = [
@@ -1947,23 +1947,23 @@ public class CameraPreview: CAPPlugin, CAPBridgedPlugin, CLLocationManagerDelega
1947
1947
  }
1948
1948
 
1949
1949
  private func isPortrait() -> Bool {
1950
- let orientation = UIDevice.current.orientation
1951
- if orientation.isValidInterfaceOrientation {
1952
- return orientation.isPortrait
1953
- } else {
1954
- let interfaceOrientation: UIInterfaceOrientation? = {
1955
- if Thread.isMainThread {
1956
- return (UIApplication.shared.connectedScenes.first as? UIWindowScene)?.interfaceOrientation
1957
- } else {
1958
- var value: UIInterfaceOrientation?
1959
- DispatchQueue.main.sync {
1960
- value = (UIApplication.shared.connectedScenes.first as? UIWindowScene)?.interfaceOrientation
1961
- }
1962
- return value
1950
+ let interfaceOrientation: UIInterfaceOrientation? = {
1951
+ let lookup: () -> UIInterfaceOrientation? = {
1952
+ let scenes = UIApplication.shared.connectedScenes.compactMap { $0 as? UIWindowScene }
1953
+ let activeScene = scenes.first { $0.activationState == .foregroundActive }
1954
+ return (activeScene ?? scenes.first)?.interfaceOrientation
1955
+ }
1956
+ if Thread.isMainThread {
1957
+ return lookup()
1958
+ } else {
1959
+ var value: UIInterfaceOrientation?
1960
+ DispatchQueue.main.sync {
1961
+ value = lookup()
1963
1962
  }
1964
- }()
1965
- return interfaceOrientation?.isPortrait ?? false
1966
- }
1963
+ return value
1964
+ }
1965
+ }()
1966
+ return interfaceOrientation?.isPortrait ?? true
1967
1967
  }
1968
1968
 
1969
1969
  private func calculateCameraFrame(xPosition: CGFloat? = nil, yPosition: CGFloat? = nil, width: CGFloat? = nil, height: CGFloat? = nil, aspectRatio: String? = nil) -> CGRect {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capgo/camera-preview",
3
- "version": "8.3.2",
3
+ "version": "8.3.4",
4
4
  "description": "Camera preview",
5
5
  "license": "MPL-2.0",
6
6
  "repository": {