Reputation: 15
I am developing an application where I press a button and it will record a 10 second video and store it in internal storage. How can I do that?
Upvotes: 0
Views: 131
Reputation: 302
Using Intent you can do this.
Intent takeVideoIntent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE);
if (takeVideoIntent.resolveActivity(getPackageManager()) != null) {
startActivityForResult(takeVideoIntent, CAMERA_REQUEST_CODE_VEDIO);
}
in onActivityResult
method
Uri videoUri = data.getData();
path = Utils.getRealPathFromURI(videoUri, this);
manageVideo(path); //Do whatever you want with your video
Upvotes: 3