我UIPickerViewController
用来从设备相机胶卷中选择图像和视频。当我选择视频时,我想选择一个最长 10 秒的视频,如果更长,以便用户可以修剪它。
到目前为止,我已经在网上搜索并做到了这一点,但它似乎不起作用:
let imagePickerController = UIImagePickerController()
imagePickerController.videoMaximumDuration = 10.0
imagePickerController.mediaTypes = ["public.image", "public.movie"]
imagePickerController.delegate = self
self.present(imagePickerController, animated: true, completion: nil)