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

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

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

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