Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to save recorded video into photo album?

Tags:

xcode

ios

iphone

Following code is to save image took from camera into photo album.

if ([mediaType isEqualToString:(NSString *)kUTTypeImage]) 
    {
         image = [info objectForKey:UIImagePickerControllerEditedImage];
        UIImageWriteToSavedPhotosAlbum(image, self,
                                       @selector(image:finishedSavingWithError:contextInfo:),
                                       nil);
    }

How to save Recoded video into photoAlbum?

like image 605
Shreedhar Avatar asked Dec 01 '22 06:12

Shreedhar


1 Answers

Check Below code...

   - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{



    NSString *mediaType = [info objectForKey:UIImagePickerControllerMediaType];
       if ([mediaType isEqualToString:@"public.movie"]){        
               // Saving the video / // Get the new unique filename 
               NSString *sourcePath = [[info objectForKey:@"UIImagePickerControllerMediaURL"]relativePath]; 
                  UISaveVideoAtPathToSavedPhotosAlbum(sourcePath,nil,nil,nil);

}
like image 173
Akshay Aher Avatar answered Dec 09 '22 13:12

Akshay Aher