[英]Problems with UIImagePickerController cancel button not working
[英]UIImagePickerController cancel button not working when compressing video
我的應用提供視頻上傳功能。 但在選擇視頻后,UIImagePickerController將執行視頻壓縮。 此時,單擊“取消”按鈕不會中斷壓縮過程。 有沒有辦法解決這個問題? 參考圖片: https : //i.stack.imgur.com/mBSAv.png
系統是iOS 12.1
let vc = UIImagePickerController()
vc.sourceType = .photoLibrary
vc.mediaTypes = [kUTTypeMovie as String]
vc.delegate = self
navigationController?.present(vc, animated: true, completion: nil)
//when compressing video left button is not responding
你無法中斷系統UIImagePickerController
視頻壓縮。
如果你需要這個功能你可以做的是初始化UIImagePickerController
與passthrough預設如下:
if (@available(iOS 11.0, *))
picker.videoExportPreset = AVAssetExportPresetPassthrough;
然后,你可以完全像管理壓縮SDAVAssetExportSession
(即系統的功能更加完善的版本AVAssetExportSession
)和一個進度指示一個模式的看法和取消按鈕調用cancelExport
您的exportSession
實例。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.