imaginary-cloud / CameraManager

Simple Swift class to provide all the configurations you need to create custom camera view in your app
MIT License
1.37k stars 324 forks source link

Landscape Left and Right Orientation Issue #255

Open tikamsingh opened 3 years ago

tikamsingh commented 3 years ago

Please help to support orientation perfectlly. I am getting issue in orientations

daliborristic883 commented 3 years ago

I can see same issue.

yangfan1233 commented 2 years ago

@daliborristic883 How to solve the issue?

joopvanduin commented 2 years ago

Same here the preview layer is halved and the view rotates.

Any solution?

hiteshcmarix commented 2 years ago

I am facing same issue but found the solution after so many days. The main issue of the orientation is in the CameraManager.swift file (Custom or cocoapod file), and you have to do changes in this file. If you are using cocoapod of the CameraManager then you have to unlock this file to do changes. Here is the solution of the landscape left and landscape right orientation issue :

In CameraManager.swift file, there is one function named "_videoOrientation", you will see switch case of deviceOrientation and in case .landscapeLeft: it will return .landscapeRight and also case .landscapeRight: it will return .landscapeLeft

So, the issue is here, you need to do below changes in those cases, and the changes are : case .landscapeLeft: return .landscapeLeft case .landscapeRight: return .landscapeRight

after you done with changes, you will check the orientation issue is fixed.

Guys, hope you will get the solution from this. 👍 Happy coding.. 😊

manuels-bts commented 1 year ago

Thanks @hiteshcmarix !