设置 MediaStore.ACTION_VIDEO_CAPTURE 最大持续时间的稳定方法
我从这里的几篇文章中了解到,用于捕获视频的 MediaStore.EXTRA_DURATION_LIMIT 只能从 2.2 版本开始工作,但我使用的是 2.3.3 版本的 Samsung Galaxy S II。下面的代码似乎对最大持续时间没有影响。
Intent intent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE);
intent.putExtra(MediaStore.EXTRA_DURATION_LIMIT, 2000);
intent.putExtra(MediaStore.EXTRA_VIDEO_QUALITY, 0);
intent.putExtra(MediaStore.EXTRA_FINISH_ON_COMPLETION,true);
startActivityForResult(intent, REQUEST_TAKE_VIDEO);
如果其设备特定,那么是否有解决此问题的方法。
I learned from few post here that MediaStore.EXTRA_DURATION_LIMIT for capturing video, could work only from versions 2.2 ,but i am using Samsung Galaxy S II which is of 2.3.3 version . The below code seems to have no effect for max duration.
Intent intent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE);
intent.putExtra(MediaStore.EXTRA_DURATION_LIMIT, 2000);
intent.putExtra(MediaStore.EXTRA_VIDEO_QUALITY, 0);
intent.putExtra(MediaStore.EXTRA_FINISH_ON_COMPLETION,true);
startActivityForResult(intent, REQUEST_TAKE_VIDEO);
If its device specific,then is there a workaround for this issue.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
文档指出
EXTRA_DURATION_LIMIT
以秒为单位。将其设置为
2000
将是 33 分钟,请尝试 2:The documentation states that
EXTRA_DURATION_LIMIT
is in seconds.Setting it to
2000
would be 33 minutes, try 2:当您将 EXTRA_VIDEO_QUALITY 设置为零时,它会创建彩信并且不能用作录像机:EXTRA_VIDEO_QUALITY
如果您想要设置 EXTRA_DURATION_LIMIT 值,那么您必须更改EXTRA_VIDEO_QUALITY 值为 1。
when you set EXTRA_VIDEO_QUALITY to zero, It is create mms and not works as a video recorder:EXTRA_VIDEO_QUALITY
If you want set value of EXTRA_DURATION_LIMIT, then you have to change EXTRA_VIDEO_QUALITY value to 1.