Video Recording like Vine and Instagram on iOS

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

I am trying to create a Vine/Instagram like Video app and having trouble with trying to record and pause video recording. Is it possible to call a pause method on Ti.Media or is it possible to record a segment and append another segment to it? Here are some code blocks I'm using...

container.startvideobutton.addEventListener('click',function()
    {
        container.progressbar.show();
        container.startvideobutton.title = "Stop";
        container.startvideobutton.backgroundImage = "/images/BUTT_red_on.png";
        container.startvideobutton.backgroundSelectedImage = '/images/BUTT_red_off.png';
        container.cameraType.visible = false;
        container.cameraFlash.visible = false;
        var startTime = new Date();
        startTime =startTime.getTime();
 
        var myVar=setInterval(function(){myTimer()},100);
 
        function myTimer()
        {
            var d=new Date();
            var t=d.getTime();
            container.progressbar.value = t-startTime;
        }
        Ti.Media.startVideoCapture();
    });
Titanium.Media.showCamera({
        overlay:container.overlay,
        showControls:false,
        allowEditing: false,
        mediaTypes: Titanium.Media.MEDIA_TYPE_VIDEO,
        videoMaximumDuration:15000,
        videoQuality:Titanium.Media.QUALITY_MEDIUM,
        transform:cameraTransform,
 
        success:function(event)
        {
            alert("video was taken");
        },
        cancel:function()
        {
        },
        error:function(error)
        {
            var a = Titanium.UI.createAlertDialog({title:'Camera'});
            if (error.code == Titanium.Media.NO_CAMERA)
            {
                a.setMessage('Please run this test on device');
            }
            else
            {
                a.setMessage('Unexpected error: ' + error.code);
            }
            a.show();
        },
 
    });

— asked 9 months ago by Irwin Nardo
1 Comment
  • Did you find a solution? Also looking for a "pause" method.

    — commented 6 weeks ago by Danny Pham

Your Answer

Think you can help? Login to answer this question!