Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-11287

iOS: landscape iPhone app: webview orientation turns to portrait after camera displayed

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.2.0
    • Fix Version/s: None
    • Labels:
    • Environment:

      cordova 6.1.1
      ios 4.1.1
      cordova-plugin-camera 2.2.0 "Camera"

      Description

      situation

      • app in landscape mode
          <preference name="Orientation" value="landscape" />
        
      • camera options
        {
         destinationType: Camera.DestinationType.FILE_URI,
         sourceType: Camera.PictureSourceType.CAMERA,
         encodingType: Camera.EncodingType.JPEG,
         mediaType: Camera.MediaType.PICTURE,
        };
        

      problem

      After displaying the camera, the app viewport turns to portrait mode - despite that the whole app is set to landscape.

      This takes place for either taking a picture or pressing cancel.

      This bug occurs only on iPhone, it works on iPad though.

      appearance
      the bug (viewport turns portrait) appears in all combinations of

      • holding phone in portrait/landscape
      • setting correctOrientation to true/false
      • using Camera.PictureSourceType.PHOTOLIBRARY/Camera.PictureSourceType.CAMERA

      possibly related
      this error occurs after closing the camera picker:

      2016-06-04 16:38:37.527 CordovaApp[2217:1174793] Warning: Attempt to present <CDVCameraPicker: 0x13ea7aa00> on <MainViewController: 0x13de3ffe0> whose view is not in the window hierarchy!
      

      regression from camera 1.2.0
      This is a regression - it works reproducably in the following configuration:

      cordova 5.3.3
      cordova-ios 3.9.1
      cordova-plugin-camera 1.2.0
      

      it slowly degraded: with cordova-plugin-camera 2.0.0 it showed wrong - but still still could changed by rotating the phone back and forth. With cordova-plugin-camera 2.0.0 the actual phone orientation makes a difference when correctOrientation is set to true - it seems that the bug occurs only when the phone is held in portrait during the camera open
      -> seems to be related to correctOrientation

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jcesarmobile jcesarmobile
                Reporter:
                mobidev3 Michael Schmidt
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: