Superpink
Superpink

Reputation: 33

How to limit duration limit recording and quality of a video with 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.

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.

Upvotes: 0

Views: 1509

Answers (1)

Fokke Zandbergen
Fokke Zandbergen

Reputation: 3866

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

Upvotes: 2

Related Questions