Hi all, I am trying to record a video using the Ti.Media.showCamera but I can't find a control for this when the camera shows up so I want to ask is there a way to record video with default iOS camera controls without custom overlay/buttons or I've to must provide custom overlay or controls? I am on ios 5 and titanium 2.1.0 Thanks in advance.
1 Answer
It works after adding - showControls and mediaTypes to your options list for showCamera. I added what should be default as per the documentation, so I am not really sure why isnt working with the code you have. Anyways, here is the working code.
btn_tkphoto.addEventListener('click',function(event) { if(Ti.Media.isCameraSupported) Ti.Media.showCamera({success:cam_success, cancel:cam_cancel, error:cam_error, saveToPhotoGallery:true, allowEditing:true, mediaTypes:[Ti.Media.MEDIA_TYPE_VIDEO,Ti.Media.MEDIA_TYPE_PHOTO], showControls:true, videoMaximumDuration:20000}) else alert('Sorry! Camera Not Supported.') }); var cam_success=function(e) { if(e.mediaType == Ti.Media.MEDIA_TYPE_PHOTO) pic=e.media; else if(e.mediaType == Ti.Media.MEDIA_TYPE_VIDEO) video=e.media; }; var cam_cancel=function() { alert('you canceled'); }; var cam_error=function(error) { alert('there was an error'); };
Your Answer
Think you can help? Login to answer this question!