The Power to Capture Video in Landscape

I am trying to get the user to use Landscape mode while capturing a video.

Question 1: Can I force user to use landscape mode while video capturing?
Question 2: Can I show some overlay image or alert to suggest the user for landscape mode when user holds device in portrait mode?

      

I tried to achieve this using the default camera app with the following piece of code,

Intent mOptionIntent = new Intent(android.provider.MediaStore.ACTION_VIDEO_CAPTURE);
mOptionIntent.putExtra("return-data", true);
startActivityForResult(mOptionIntent, REQUEST_CAPTURE_VIDEO);

      

I found that we can query the orientation of the output by specifying EXTRA_SCREEN_ORIENTATION as shown below. It may work on some devices only if OEMs

not changed. And even if this happens, the camera can be opened in Portrait

and save the data using Landscape orientation

, so there is no way to set the Landscape

camera:

mOptionIntent.putExtra(MediaStore.EXTRA_SCREEN_ORIENTATION, ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);

      

So my concern is with orientation during video capture, I want insist user or lock the screen in Landscape mode

.

+3


source to share


1 answer


I created a library called LandscapeVideoCapture that does just that.

In the portrait, you will get an image indicating that the user has to rotate their device, and it is only when the device is in the landscape that the user can actually start capturing the video.



Take a look here: https://github.com/jmolsmobile/LandscapeVideoCapture

In addition, this library has many other features like resolution, frame rate, capture quality, ...

+4


source







All Articles