I used video capturing code using the built-in camera in an application, but it reported issues on some Android phones like Motorola fusion, Oppo A93, OnePlus phones. On other phones it works perfectly, can anyone help me to solve this issue, I tried many times but it didn't work, I'm sharing my code below.
private void captureVideo() {
Intent VideoIntent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE);
if (VideoIntent.resolveActivity(getPackageManager()) != null) {
VideoIntent.putExtra(MediaStore.EXTRA_VIDEO_QUALITY, 1);
VideoIntent.putExtra("android.intent.extras.CAMERA_FACING", 1);
VideoIntent.putExtra(MediaStore.EXTRA_DURATION_LIMIT, 3);
VideoIntent.putExtra(MediaStore.EXTRA_FINISH_ON_COMPLETION,true);
startActivityForResult(VideoIntent, VIDEO_REQUEST);
}
}
I get a solution for my own question. I added below code to my manifest file. so its working fine in every devices now.