如何使用Appcelerator限制持续时间限制的录制和视频质量

问题描述:

我正在制作一个允许用户发布视频的应用程序.我只想限制视频的持续时间和质量.

I am making an application that allow users to post their videos. I just want to limit the duration and the quality of the videos.

在iOS中,使用不同的选项没问题.

In iOS, no problem with different options.

对于Android,我使用Intent启动相机.我看到我们必须可以设置持续时间(这是android开发人员指南中的一个示例):

For Android, I use intent to launch camera. I saw that we have to possibility to set duration with (it's an example from android developer guide) :

intent.putExtra(MediaStore.EXTRA_VIDEO_QUALITY, 1);
intent.putExtra(MediaStore.EXTRA_DURATION_LIMIT, 8);

我试图通过不同的方式来做到这一点,但是不可能.

I tried to do this, from different ways but impossible.

这是我的代码的一部分:

Here is a part of my code :

        var intent = Titanium.Android.createIntent({ action: 'android.media.action.VIDEO_CAPTURE' });
        intent.putExtra("android.provider.MediaStore.EXTRA_VIDEO_QUALITY",0);
        intent.putExtra("android.provider.MediaStore.EXTRA_DURATION_LIMIT",10);
        $.upload.activity.startActivityForResult(intent, function(e) {

有人知道怎么做吗,真的很烦人.

Does anyone has an idea how to do this, it's really annoying.

谢谢.

请改用android.intent.extra.durationLimit,因为这是

Try android.intent.extra.durationLimit instead, as that is the listed as value for the android.provider.MediaStore.EXTRA_DURATION_LIMIT constant.