选择视频问题! didFinishPickingMediaWithInfo调用委托未在iOS 13中触发

时间:2019-10-26 18:58:20

标签: swift video uiimagepickercontroller ios13

在ios13中使用UIImagePickerController选择视频有问题吗?

    let myImagePickerController = UIImagePickerController()
    myImagePickerController.sourceType = .savedPhotosAlbum
    myImagePickerController.mediaTypes = [ ( kUTTypeMovie ) as String ,( kUTTypeImage ) as String ]
    myImagePickerController.delegate = self
    myImagePickerController.isEditing = false
    myImagePickerController.navigationBar.isHidden = true
    myImagePickerController.modalPresentationStyle = .fullScreen

解决此问题的方法是

let myImagePickerController = UIImagePickerController()
myImagePickerController.sourceType = .savedPhotosAlbum
myImagePickerController.mediaTypes = [ ( kUTTypeMovie ) as String ,( kUTTypeImage ) as String ]
myImagePickerController.delegate = self
myImagePickerController.isEditing = false
myImagePickerController.navigationBar.isHidden = true
myImagePickerController.modalPresentationStyle = .fullScreen
if #available(iOS 11.0, *) {
      myImagePickerController.videoExportPreset = AVAssetExportPresetPassthrough
}

就这样! ?

0 个答案:

没有答案