如何使用 Appcelerator 限制持续时间限制录制和视频质量 [英] How to limit duration limit recording and quality of a video with Appcelerator

查看:30
本文介绍了如何使用 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.

这篇关于如何使用 Appcelerator 限制持续时间限制录制和视频质量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆