Div S
Div S

Reputation: 231

how to set duration of native video recorder?

I want to bound the duration of the video recording into my app up to 10 seconds only. And for that i am doing following thing:

            Intent takePictureIntent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE);
            takePictureIntent.putExtra("android.provider.MediaStore.EXTRA_DURATION_LIMIT", 10000);
            startActivityForResult(takePictureIntent, MyScreen.ACTION_TAKE_VIDEO);

But the video recording not stops on 10 seconds it running continusly.. So is it possible to set duration of video of native Cemara???

Thanks in Advance: Rgards,

Upvotes: 3

Views: 1008

Answers (2)

Jason Hu
Jason Hu

Reputation: 1267

I had this problem too. The extra MediaStore.EXTRA_DURATION_LIMIT takes a long, not an int. So if you put the 10000 in a long, and pass it in, it'll work.

Upvotes: 0

Jong
Jong

Reputation: 9125

Remove the "" from "android.provider.MediaStore.EXTRA_DURATION_LIMIT". You are sending this string name value while you should send the constant's value, which is "android.intent.extra.durationLimit".

Upvotes: 2

Related Questions