Home » » Using MediaStore.EXTRA_OUTPUT specify target file for MediaStore.ACTION_VIDEO_CAPTURE

Using MediaStore.EXTRA_OUTPUT specify target file for MediaStore.ACTION_VIDEO_CAPTURE

Written By MR HARI on Sabtu, 07 Mei 2011 | 03.17




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 this article :

0 komentar:

Posting Komentar

 
Support : Your Link | Your Link | Your Link
Copyright © 2013. Android Center - All Rights Reserved
Template Created by Creating Website Published by Mas Template
Proudly powered by Blogger