简体   繁体   English

android上捕获视频的最长持续时间

[英]Max duration for capture video on android

I have code for capturing a video clip on Android: 我有在Android上捕获视频剪辑的代码:

Intent intent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE);
intent.putExtra("android.intent.extra.durationLimit", 30000);
intent.putExtra("EXTRA_VIDEO_QUALITY", 0);
startActivityForResult(intent, ActivityRequests.REQUEST_TAKE_VIDEO);

This code works well on API 2.2, but the duration limit does not work on API 2.1 (Galaxy S). 此代码适用于API 2.2,但持续时间限制不适用于API 2.1(Galaxy S)。 Is there some constant or parameter for setting this time, or is there a better approach than the one I am taking? 设定这个时间是否有一些常数或参数,或者是否有比我正在使用的方法更好的方法?

I ask because I found another application that works on the Galaxy S (called Vibrant ) which can record video for a short amount of time. 我问,因为我找到了另一个适用于Galaxy S的应用程序(称为Vibrant ),可以在很短的时间内录制视频。

android.intent.extra.durationLimit was introduced in API Level 8, so it's not available in Eclair and earlier, unfortunately. android.intent.extra.durationLimit是在API Level 8中引入的,所以不幸的是,它在Eclair和更早版本中不可用。 Some device manufacturers may have a proprietary way to set the maximum duration on older devices, which explain why you have seen this working on some pre-Froyo applications. 某些设备制造商可能采用专有方法设置旧设备的最大持续时间,这可以解释为什么您已经看到这种方法可用于某些Froyo之前的应用程序。

For your information it does not run on HTC devices. 对于您的信息,它不能在HTC设备上运行。 welcome to the android world. 欢迎来到android世界。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM