@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.
package/android/build.gradle
CHANGED
|
@@ -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.
|
|
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.
|
|
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
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
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
|
-
|
|
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 {
|