Loading

Saturday, May 7, 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.

SHARE TWEET

Thank you for reading this article Using MediaStore.EXTRA_OUTPUT specify target file for MediaStore.ACTION_VIDEO_CAPTURE With URL http://x-tutorials.blogspot.com/2011/05/using-mediastoreextraoutput-specify.html. Also a time to read the other articles.

0 comments:

Write your comment for this article Using MediaStore.EXTRA_OUTPUT specify target file for MediaStore.ACTION_VIDEO_CAPTURE above!