Posts

Showing posts from January, 2013

How to record video in iPhone & with time restriction

Now Create a button in Interface builder & connect that button to your code Use  this code in .h file -( IBAction )recordVideo:( id )sender; Use this in the .m file -( IBAction )recordVideo:( id )sender {     kpImagePickerController =[[ UIImagePickerController alloc ] init ];  //kpImagePickerController object of UIImagePickerController     if ([ UIImagePickerController isSourceTypeAvailable : UIImagePickerControllerSourceTypeCamera ])     {         [ kpImagePickerController setSourceType : UIImagePickerControllerSourceTypeCamera ];         [ kpImagePickerController setMediaTypes :[ NSArray arrayWithObject :( NSString *) kUTTypeMovie ]];         kpImagePickerController . videoQuality = UIImagePickerControllerQualityTypeMedium ;         kpImagePickerController . videoMaximumDuration = 30 ; // Here we are restrict the time of...

How to show iPhone Video library in UITableview programatically

Use the following code in XCode -( void )viewDidAppear:( BOOL )animated {     assetsCollection =[[ NSMutableArray alloc ] init ];   al =[[ ALAssetsLibrary alloc ] init ];     UIImage *viewImage;     [ al writeImageToSavedPhotosAlbum :[viewImage CGImage ] orientation :( ALAssetOrientation )[viewImage imageOrientation ] completionBlock :^( NSURL *assetURL, NSError *error){         if (error) {             NSLog ( @"error" );         } else {             NSLog ( @"url %@" , assetURL);                                   }       }];          [ al enumerateGroupsWithTypes : ALAssetsGroupAll usingBlock :^( ALAssetsGroup *group, BOOL *stop)     {         if (group!...