如何使用 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
代替,因为那是 列为android.provider.MediaStore.EXTRA_DURATION_LIMIT
常量的值.
Try android.intent.extra.durationLimit
instead, as that is the listed as value for the android.provider.MediaStore.EXTRA_DURATION_LIMIT
constant.