Need video triming code !!

You must Login before you can answer or comment on any questions.

Hi, I want to develop a mobile application for iphone and android which will take a video and can trim to 30 seconds. So what will be the example code can anyone help me??

Thanks in advance.

3 Answers

Accepted Answer

You cant do that with Ti by default. If there is no Module (check out the marketplace) then Ti is the wrong choice. You gotta go natively to xcode/java.

If You mean that, you want record video for first 30 seconds then use

videoMaximumDuration: time_in_milli_seconds,
with the show camera function... such the show camera looks like
Ti.Media.showCamera({
              success: function(event) {
                  // do something with event.media
              },
              cancel: function() {},
              error: function(error) {
                return Ti.API.error(error);
              },
              mediaTypes: [Titanium.Media.MEDIA_TYPE_VIDEO],
              videoMaximumDuration: 30 * 1000, //30 seconds
              saveToPhotoGallery: true,
              videoQuality: Titanium.Media.QUALITY_LOW
            });
hope this will help you...

— answered 11 months ago by Ramkumar Murugadoss
answer permalink
1 Comment
  • Thanks Ramkumar

    But I dont want to record video only 30 seconds. Let me explain in details. Let I have recorded 5 minutes video then I can select a starting point and ending point. After that i will keep that portion video from whole video. and can post to any social media.

    I am a very new developer in titanium. So if I asked silly question please pardon me.

    — commented 11 months ago by Feroj Bepari

Hi Feroj,

There is no build in options in Titanium to do like what you are asking... Only way is that you need to write a Titanium mobile module using native code and embed it to Titanium

Your Answer

Think you can help? Login to answer this question!