What's New with MediaStore Duration Limit in Android 7? There is nothing about this in the documentation, but since sdk 24, the device records video without any restrictions.
final Activity activity = (Activity) context;
String controlId = videoInput.getControlId();
Intent intent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE);
if (videoInput.getMaxDuration() > 0) {
intent.putExtra(MediaStore.EXTRA_DURATION_LIMIT, videoInput.getMaxDuration());
}
intent.putExtra(MediaStore.EXTRA_VIDEO_QUALITY, videoInput.getRecordQuality().ordinal());
int requestCode = ActivityResultBus.getInstance().generateRequestCode(new SBundle(controlId));
activity.startActivityForResult(intent, requestCode);
I tested it on a real Motorola Nexus 6 with Android 7.0 and on virtual devices with 7.0 and 7.1.1. In previous versions, everything works the way I want.
Is there something wrong with my package extras?

source
share