iphone imagepickerController picking video from photo library

前端 未结 2 1574
猫巷女王i
猫巷女王i 2020-12-18 12:11

I am now trying to implement a app like picking image and video from device photo album and uploading it to server..

here i can able to display both image and video

相关标签:
2条回答
  • 2020-12-18 12:20

    It is Verified and Tested on Both iPhone and iPad For picking video.

    @property (strong,nonatomic) UIPopoverController *popOver;
    

    property is Set For iPad access.

    UIImagePickerController *videoPicker=[[UIImagePickerController alloc] init];
    videoPicker.sourceType=UIImagePickerControllerSourceTypePhotoLibrary;
    videoPicker.mediaTypes=[[NSArray alloc] initWithObjects:(NSString *)kUTTypeMovie, nil];
    videoPicker.delegate=self;
    
    if( UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
    {
        UIPopoverController *popController=[[UIPopoverController alloc] initWithContentViewController:videoPicker];
        [popController presentPopoverFromRect:CGRectMake(0, 600, 160, 300) inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
        self.popOver=popController;
    }
    else
    {
        [self presentViewController:videoPicker animated:YES completion:nil];
    }
    
    0 讨论(0)
  • 2020-12-18 12:31

    Check the docs and choose what type you need.

    myImagePickerController.mediaTypes =
        [[NSArray alloc] initWithObjects: (NSString *) kUTTypeMovie, nil];
    
    0 讨论(0)
提交回复
热议问题