[英]PHPickerViewController add video editing screen aka (UIImagePickerController.allowsEditing = true)
I would like to edit/compress video after selection like it was in UIImagePickerController
with allowsEditing = true
.我想在选择后编辑/压缩视频,就像在
UIImagePickerController
中一样,使用allowsEditing = true
。
Still the new PHPickerViewController
doesn't have this property and Apple
says that there is no such property anymore here .新的
PHPickerViewController
仍然没有这个属性, Apple
说这里不再有这个属性。 But there are apps in App Store that pushing "allowsEditing controller" after selecting asset from PHPickerViewController
但是 App Store 中有应用程序在从
PHPickerViewController
选择资产后推送“allowsEditing 控制器”
Here is my PHPickerViewController implementation:这是我的 PHPickerViewController 实现:
func openImagePicker() {
if #available(iOS 14, *) {
var configuration = PHPickerConfiguration()
configuration.preferredAssetRepresentationMode = .automatic
let picker = PHPickerViewController(configuration: configuration)
// Set the delegate
picker.delegate = self
// Present the picker
present(picker, animated: true)
} else {
// Fallback on earlier versions
imagePicker?.photoGalleryAsscessRequest()
}
}
extension EditController: PHPickerViewControllerDelegate {
@available(iOS 14, *)
func picker(_ picker: PHPickerViewController, didFinishPicking results: [PHPickerResult]) {
self.dismiss(animated: true)
}
}
I investigated this issue but indeed there is no support for like as you mention allowsediting
.我调查了这个问题,但确实不支持 like 你提到
allowsediting
。
For example related to your question preset values for video edits was depreciated to UIImagePickerController.ImageURLExportPreset.compatible
but There is no support for automatic compression.例如,与您的问题预设值相关的视频编辑已折旧为
UIImagePickerController.ImageURLExportPreset.compatible
但不支持自动压缩。 The picker will always pass the original video/image and it is up to the app to do the necessary compressions or edits.选择器将始终传递原始视频/图像,并由应用程序进行必要的压缩或编辑。 You can check this Apple Document: imageExportPreset .
您可以查看此 Apple 文档: imageExportPreset 。
Apple specifically mentions that we should be using this new one instead of the older UIImagePickerViewController.苹果特别提到我们应该使用这个新的而不是旧的 UIImagePickerViewController。 If someone wonder more: Meet the new Photos picker
如果有人想知道更多:认识新的照片选择器
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.