Reputation: 231
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
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
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