Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/187.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/google-apps-script/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 为MediaStore.ACTION\u视频捕获设置最大持续时间的稳定方法_Android_Android Intent_Video Capture - Fatal编程技术网

Android 为MediaStore.ACTION\u视频捕获设置最大持续时间的稳定方法

Android 为MediaStore.ACTION\u视频捕获设置最大持续时间的稳定方法,android,android-intent,video-capture,Android,Android Intent,Video Capture,我从这里的一些帖子中了解到,MediaStore.EXTRA_DURATION_捕获视频的限制只能在2.2版本中使用,但我使用的是三星Galaxy S II,它是2.3.3版本。以下代码似乎对最大持续时间没有影响 Intent intent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE); intent.putExtra(MediaStore.EXTRA_DURATION_LIMIT, 2000); intent.putExtra(MediaStore

我从这里的一些帖子中了解到,MediaStore.EXTRA_DURATION_捕获视频的限制只能在2.2版本中使用,但我使用的是三星Galaxy S II,它是2.3.3版本。以下代码似乎对最大持续时间没有影响

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);

如果是特定于设备的,那么是否有解决此问题的方法

文件规定,
额外持续时间限制
秒为单位

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

intent.putExtra(MediaStore.EXTRA_DURATION_LIMIT, 2);

当您将EXTRA_VIDEO_QUALITY设置为零时,它将创建彩信,而不会用作录像机:


如果您想要设置额外的持续时间限制值,那么您必须将额外的视频质量值更改为1。

(与@ermu达成一致)在htc evo和htc Inclusible设备上仍然面临同样的问题。在NexusOne上运行良好。任何人都知道它的解决方案是什么。同样的,在Nexus-s上运行良好,但在htc desire hd上却不行。。。我把时间限制在30秒。