Skip to content
This repository has been archived by the owner on Sep 25, 2019. It is now read-only.

How can i change the camera's orientation to portrait? #1

Closed
yinghuihong opened this issue Aug 4, 2015 · 4 comments
Closed

How can i change the camera's orientation to portrait? #1

yinghuihong opened this issue Aug 4, 2015 · 4 comments

Comments

@yinghuihong
Copy link

No description provided.

@NayanaRBhoj
Copy link

How can i change the camera's orientation to portrait? did anyone found solution to this???

This was referenced Sep 14, 2016
@helinfeng
Copy link

mPreview.setRotation(90); this way can change orientation!

@tec-anDro-DeV
Copy link

tec-anDro-DeV commented Dec 20, 2018

@NayanaRBhoj @yinghuihong

Add Below code in prepareVideoRecorder() Method

 Display display = ((WindowManager) getSystemService(WINDOW_SERVICE)).getDefaultDisplay();

        if (display.getRotation() == Surface.ROTATION_0) {
            mCamera.setDisplayOrientation(90);

        } else if (display.getRotation() == Surface.ROTATION_270) {
            mCamera.setDisplayOrientation(180);
        } else {
            // Set the preview aspect ratio.
        }

@dturner
Copy link
Contributor

dturner commented Jan 10, 2019

Please reopen if the code from @tec-anDro-DeV doesn't work for you

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants