You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I am having a minor issue on launching the camera on ipad from landscape, the default connection video orientation is always portrait. but rotating the device fixes the issue. looking through the code it looks like the preview layer for cameraView initialization didn't start with the current device orientation. Just thought I bring this up.
This library is a pleasure to use, thanks for the great work!
i fixed it by doing the following changes in cameraView.swift if you decided to use it.
Hi,
I am having a minor issue on launching the camera on ipad from landscape, the default connection video orientation is always portrait. but rotating the device fixes the issue. looking through the code it looks like the preview layer for cameraView initialization didn't start with the current device orientation. Just thought I bring this up.
This library is a pleasure to use, thanks for the great work!
i fixed it by doing the following changes in cameraView.swift if you decided to use it.
func setupPreviewLayer(_ session: AVCaptureSession) {
guard previewLayer == nil else { return }
let layer = AVCaptureVideoPreviewLayer(session: session)
layer.autoreverses = true
layer.videoGravity = .resizeAspectFill
//-----adding the following code here seems to fix the issue --------------
if let connection = layer.connection,
connection.isVideoOrientationSupported {
connection.videoOrientation = Utils.videoOrientation()
}
//-----end fix--------------
self.layer.insertSublayer(layer, at: 0)
layer.frame = self.layer.bounds
previewLayer = layer
}
The text was updated successfully, but these errors were encountered: