设置MediaStore的最大持续时间的稳定方法 [英] Stable way to set Max duration for MediaStore.ACTION_VIDEO_CAPTURE

查看:38
本文介绍了设置MediaStore的最大持续时间的稳定方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从这里的几篇博文中了解到,用于捕获视频的MediaStore.EXTRA_DURATION_LIMIT仅可用于2.2版,但我使用的是2.3.3版的Samsung Galaxy S II.以下代码似乎对最大持续时间无效.

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.

推荐答案

文档指出EXTRA_DURATION_LIMIT为单位.

将其设置为2000将需要 33分钟,请尝试2:

Setting it to 2000 would be 33 minutes, try 2:

intent.putExtra(MediaStore.EXTRA_DURATION_LIMIT, 2);

这篇关于设置MediaStore的最大持续时间的稳定方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆