Saturday, 7 May 2011

Using MediaStore.EXTRA_OUTPUT specify target file for MediaStore.ACTION_VIDEO_CAPTURE




When I write this post, i tested it on Nexus One running 2.2.1.
It work as expected at that time.

But...I re-test it again on Nexus One updated 2.3.4 - it cannot save the video in SD Card.

It seem to be related to the right of folder/file between the app and the Camera App!
- Not yet solved-

Android Er@2011-06-16



MediaStore.EXTRA_OUTPUT is the the name of the Intent-extra used to indicate a content resolver Uri to be used to store the requested image or video.

The article "Start Video Recording using android.provider.MediaStore.ACTION_VIDEO_CAPTURE" save the captured video in default Uri. You can use the code below to specify target file for MediaStore.ACTION_VIDEO_CAPTURE:

Intent intent = new Intent(android.provider.MediaStore.ACTION_VIDEO_CAPTURE);

//Specify target file
String MyVideoFilePath = "/sdcard/test/myvideo.3gp";
File imageFile = new File(MyVideoFilePath);
Uri imageFileUri = Uri.fromFile(imageFile);
intent.putExtra(android.provider.MediaStore.EXTRA_OUTPUT, imageFileUri);
//---

startActivityForResult(intent, REQUEST_VIDEO_CAPTURED);


Download the files.

No comments:

Post a Comment