Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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,

like image 847
Div S Avatar asked Dec 08 '25 06:12

Div S


1 Answers

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".

like image 114
Jong Avatar answered Dec 10 '25 21:12

Jong



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!