How to record a video Only 2 min in titanium

838 views Asked by At

I have tried recording a video for only 1 min with Titanium in Android using this function:

var intent = Titanium.Android.create Intent({action : 'android.media.action.VIDEO_CAPTURE'})

and I've set duration limit with intent.putExtra("android.intent.extra.durationLimit", 10000)like in core android, but this property is not working in Titanium.So how can I set video recording duration in Titanium???

Thanks

2

There are 2 answers

0
user123 On

You are doing the right thing.. You are just missing that

intent.putExtra("android.intent.extra.durationLimit", 10000)

takes seconds, not mili-seconds.

Therefore it should be

intent.putExtra("android.intent.extra.durationLimit", 60);
1
mohamed al-ashry On

you can record the video then check the video duration after by getDuration() method