我正在尝试构建一个应用程序,让用户从 iPad 上的库中挑选和上传视频。我需要视频分辨率为 960x540。
我正在使用以下代码:
UIImagePickerController *mediaPicker = [[UIImagePickerController alloc] init];
mediaPicker.mediaTypes = [NSArray arrayWithObjects:(NSString *)kUTTypeMovie,(NSString *)kUTTypeImage,nil];
mediaPicker.sourceType = UIImagePickerControllerSourceTypeSavedPhotosAlbum;
mediaPicker.videoQuality = UIImagePickerControllerQualityTypeIFrame960x540;
mediaPicker.videoMaximumDuration = 30.0f;
mediaPicker.delegate = self;
if (self.imagePickerPopOverController.popoverVisible) {
[self.imagePickerPopOverController dismissPopoverAnimated:YES];
}
self.imagePickerPopOverController = [[UIPopoverController alloc] initWithContentViewController:mediaPicker];
[self.imagePickerPopOverController presentPopoverFromBarButtonItem:self.navigationItem.rightBarButtonItem
permittedArrowDirections:UIPopoverArrowDirectionUp
animated:NO];
当我使用上面的代码从相机中选择图像时,尺寸是 960x540,但是当我从画廊做同样的事情时,它的尺寸是 640x360。