我希望用户可以从他的库中选择一个视频,并将其限制在45秒内(例如WhatsApp-您可以编辑视频,发送的视频不超过45秒)。
但是,如果我使用以下代码,则无论持续时间如何都会选择视频,而我无法修剪它(已测试过一分钟的视频长度)。
在WhatsApp中,我得到了以下屏幕,我想复制它:
UIImagePickerController *imagePickerController = [[UIImagePickerController alloc] init];
imagePickerController.delegate = self;
imagePickerController.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
imagePickerController.videoQuality = UIImagePickerControllerQualityTypeLow;
imagePickerController.videoMaximumDuration = 45.0f; //?
imagePickerController.mediaTypes = [UIImagePickerController availableMediaTypesForSourceType:UIImagePickerControllerSourceTypePhotoLibrary];
[[self parentViewController] presentModalViewController:imagePickerController animated:YES];
[imagePickerController release];
在WhatsApp中,我得到了以下屏幕,我想复制它:
![输入图像说明](https://istack.dev59.com/IE0ca.webp)