0

I have to record video for a specified time duration.

Intent intent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE);
intent.putExtra(android.provider.MediaStore.EXTRA_OUTPUT,
                    Uri.fromFile(videoTempFile));
intent.putExtra(MediaStore.EXTRA_DURATION_LIMIT, videoRecordDuration);
startActivityForResult(intent, CAPTURE_VIDEO_ACTIVITY_REQUEST_CODE);

videoRecordDuration has value 60 seconds. The above code will open default device camera with image capture and video recording option. If the user did not select any of this and keep the device idle with camera opened. After 60 seconds the app exited camera app and returned to my application. How to count down MediaStore.EXTRA_DURATION_LIMIT if and only if user select either camera or video using default camera app?

Asha Soman
  • 1,846
  • 1
  • 18
  • 28

1 Answers1

0

I guess you want to record video automaticaly for 60 seconds with single button click inside the app

I sugest you should implement your own in app camera vido record in surface view insted of redirecting to camera app following is helping link to implement this Custom Video Recording Screen

Community
  • 1
  • 1
Miral Bhalani
  • 274
  • 2
  • 9