关于用自带摄像机录像无法捕获uri 问题解决

这个 我自己调用,好像并没有出现什么问题。

下面是我的代码。你们可以参照一下

File file = new File(Environment.getExternalStorageDirectory()+"/sherwel/pic");

Bundle extras = getIntent().getExtras();
Intent intent=new Intent(MediaStore.ACTION_VIDEO_CAPTURE);
String sdStatus = Environment.getExternalStorageState();
if(sdStatus.equals(Environment.MEDIA_MOUNTED))
{
File f=new File(file, extras.getString("videopath")+".mp4");
Uri u=Uri.fromFile(f);
intent.putExtra(MediaStore.EXTRA_OUTPUT, u);
intent.putExtra(MediaStore.EXTRA_VIDEO_QUALITY, 0);
startActivityForResult(intent, 3);
}
else
Toast.makeText(this, "没有内存卡", Toast.LENGTH_LONG).show();

} catch (Exception e) {
e.printStackTrace();
}

 

从我的代码里 看好像也就是这样。我也觉得没什么好讲的。但是看见网上有人会遇到这样的情况。我就贴出来哈。

有人会问我,后面摄像机录像完后的代码是什么。

由于我是不对这个文件做处理。

所以我后面没有处理的相关代码。

即 当你拍完的时候,并且你点了储存。他就自动储存在你要的地方。

 

posted @ 2014-03-23 23:11  sherwel  阅读(386)  评论(0编辑  收藏  举报