How to limit duration limit recording and quality of a video with Appcelerator

耗尽温柔 提交于 2019-12-12 04:59:27

问题


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.

In iOS, no problem with different options.

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.

Thank you.


回答1:


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



来源:https://stackoverflow.com/questions/36224075/how-to-limit-duration-limit-recording-and-quality-of-a-video-with-appcelerator

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!