Skip to content

Instantly share code, notes, and snippets.

@SongJiaqiang
Last active July 20, 2018 04:09
Show Gist options
  • Save SongJiaqiang/1faeaba490cf1ec47b9fe757fa713f15 to your computer and use it in GitHub Desktop.
Save SongJiaqiang/1faeaba490cf1ec47b9fe757fa713f15 to your computer and use it in GitHub Desktop.
从相册选取视频
- (void)pickVideoFromAlbum {
UIImagePickerController *videoPicker = [[UIImagePickerController alloc] init];
videoPicker.delegate = self;
videoPicker.modalPresentationStyle = UIModalPresentationCurrentContext;
videoPicker.mediaTypes =[UIImagePickerController availableMediaTypesForSourceType:UIImagePickerControllerSourceTypePhotoLibrary];‌​
videoPicker.mediaTypes = @[(NSString*)kUTTypeMovie, (NSString*)kUTTypeAVIMovie, (NSString*)kUTTypeVideo, (NSString*)kUTTypeMPEG4];
videoPicker.videoQuality = UIImagePickerControllerQualityTypeHigh;
[self presentViewController:videoPicker animated:YES completion:nil];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment