Android 上捕获视频的最大持续时间

发布于 2024-09-26 03:21:29 字数 474 浏览 0 评论 0原文

我有用于在 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);

此代码在 API 2.2 上运行良好,但持续时间限制在 API 2.1 (Galaxy S) 上不起作用。是否有一些常量或参数用于设置这次,或者是否有比我正在采取的方法更好的方法?

我问这个问题是因为我发现了另一个适用于 Galaxy S 的应用程序(名为 Vibrant),它可以录制短时间内的视频。

I have code for capturing a video clip on 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). 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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

情仇皆在手 2024-10-03 03:21:29

android.intent.extra.durationLimit 是在 API Level 8 中引入的,因此不幸的是,它在 Eclair 及更早版本中不可用。一些设备制造商可能有一种专有的方法来设置旧设备上的最大持续时间,这解释了为什么您在某些 Froyo 之前的应用程序上看到了这种方法。

android.intent.extra.durationLimit was introduced in API Level 8, so it's not available in Eclair and earlier, unfortunately. 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.

烟─花易冷 2024-10-03 03:21:29

供您参考,它不能在 HTC 设备上运行。欢迎来到安卓世界。

For your information it does not run on HTC devices. welcome to the android world.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文