0

enter image description hereI need full screen on Video Capture but I am unable to do.I am posting my code.please help me

  public void startRecordingVideo() {
    if (getActivity().getPackageManager().hasSystemFeature(PackageManager.FEATURE_CAMERA_FRONT)) {
        Intent intent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE);
        File mediaFile = new File(
                Environment.getExternalStorageDirectory().getAbsolutePath() + "/myvideo.mp4");
        videoUri = Uri.fromFile(mediaFile);
        intent.putExtra(MediaStore.EXTRA_OUTPUT, videoUri);
        startActivityForResult(intent, VIDEO_CAPTURE);
    } else {
        Toast.makeText(this.getActivity(), "No camera on device", Toast.LENGTH_LONG).show();
    }
}
user8601021
  • 219
  • 3
  • 18

1 Answers1

1

From the Android MediaStore documentation ,

EXTRA_FULL_SCREEN

The name of an Intent-extra used to control the UI of a ViewImage. This is a boolean property that overrides the activity's default fullscreen state.

And there is one more case where it give the padding is because of the camera resolution, in my case if i use 320*240 it is giving the same padding but if i use the 1280*720 or more than that it is not showing any padding and fitting the full screen.

For this you can use MediaStore.EXTRA_VIDEO_QUALITY parameter to set the video quality also.

So in your case try to use like this ,

 public void startRecordingVideo() {
    if (getActivity().getPackageManager().hasSystemFeature(PackageManager.FEATURE_CAMERA_FRONT)) {
        Intent intent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE);
        File mediaFile = new File(
                Environment.getExternalStorageDirectory().getAbsolutePath() + "/myvideo.mp4");
        videoUri = Uri.fromFile(mediaFile);
        intent.putExtra(MediaStore.EXTRA_VIDEO_QUALITY, 1);
        intent.putExtra(MediaStore.EXTRA_FULL_SCREEN , true);
        intent.putExtra(MediaStore.EXTRA_OUTPUT, videoUri);
        startActivityForResult(intent, VIDEO_CAPTURE);
    } else {
        Toast.makeText(this.getActivity(), "No camera on device", Toast.LENGTH_LONG).show();
    }
}
King of Masses
  • 18,405
  • 4
  • 60
  • 77
  • I still see the padding on both sides of the camera during recording video and also showing video. – user8601021 Oct 04 '17 at 06:59
  • ASAIK this is the only way to set the full screen mode for video through the Intent. are you talking about the video recording time / after saved video with in the video your seeing padding ? – King of Masses Oct 04 '17 at 07:03
  • I have edited my question with a screenshot of the recording screen with padding on both sides.Please check it and help me. – user8601021 Oct 04 '17 at 07:07