CameraView icon indicating copy to clipboard operation
CameraView copied to clipboard

[BUG] lockCameraInPortraitOrientation breaks app orientation configuration

Open tiendq opened this issue 1 year ago • 1 comments

Prerequisites

  • [x] I checked the documentation and found no answer
  • [x] I checked to make sure that this issue has not already been filed

Expected Behavior

App orientation configuration should work e.g. app only allows Portrait orientation should never rotate.

Current Behavior

App orientation works correctly (Portrait app never rotate) until you open camera, then after that app will rotate and no longer locked to portrait as configured.

Steps to Reproduce

Please provide detailed steps for reproducing the issue.

  1. Allow only Portrait orientation in app configuration
  2. Build and run app
  3. Open camera and close it (rotate your phone to make if necessary)
  4. Rotate your phone and app is no longer locked in portrait orientation

Code Sample

Same as https://github.com/Mijick/Camera/wiki/Configuring-MCamera#blocking-camera-rotation

Even I set portrait in this line static var orientationLock = UIInterfaceOrientationMask.portrait

Screenshots

If applicable, add screenshots to help explain your problem.

Context

Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.

Name Version
SDK e.g. 3.0.1
Xcode e.g. 16.2
Operating System e.g. iOS 17.7
Device e.g. iPhone 11

tiendq avatar Feb 14 '25 17:02 tiendq

I just read the code and fixed the issue, please take a look at my PR. Thanks.

tiendq avatar Feb 15 '25 04:02 tiendq