1

I have to record a video with time limitation of 10 seconds. I am trying so many ways but nothing is working fine.

Here is my code:-

 Intent takeVideoIntent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE);
 //videoUri = Uri.fromFile(mediaFile);
 videoUri = getOutputMediaFileUri(MEDIA_TYPE_VIDEO);
 takeVideoIntent.putExtra(MediaStore.EXTRA_OUTPUT, videoUri);
takeVideoIntent.putExtra("android.intent.extra.durationLimit", 10);
 //takeVideoIntent.putExtra("android.intent.extra.sizeLimit",10);
//takeVideoIntent.putExtra(MediaStore.EXTRA_DURATION_LIMIT, 10);
//takeVideoIntent.putExtra(MediaStore.EXTRA_SIZE_LIMIT, 1024*1024*30);
 takeVideoIntent.putExtra("EXTRA_VIDEO_QUALITY", 0);
 startActivityForResult(takeVideoIntent, REQUEST_VIDEO_CAPTURE);

as it is clear that I have tried many ways to perform the task but nothing worked well. please let me know what mistake I am doing here. My android device is using CYANOGEN OS

Devraj
  • 1,479
  • 1
  • 22
  • 42

0 Answers0