iOS 11.1 UIImagePickerController video crop start time not movable

不羁岁月 提交于 2019-12-06 09:30:37

问题


We are displaying a UIImagePickerController for users to choose (and crop) a video for use within our app. Recently users have been experiencing issues trying to crop videos, with the start time handle becoming almost impossible to drag.

It seems that the Photos app doesn't have this issue because the video timeline (and crop selection) is moved to the bottom of the screen.

I assume this has to do with the new notification centre gestures that were added for the iPhone X. I believe this question here is related to the issue we're experiencing.

Anyone else having this issue, or have a way to get around it? Since this is a stock UIViewController I can't see how we can get around the issue without building our own custom video picker/cropper.


回答1:


I was having the same issue and I decided to disable the UIImagePickerController editing and catch the video path in the UIImagePIckerController's didFinishPickingMediaWithInfo, and then use UIVideoEditorController to edit the video. This is a quick example:

if UIVideoEditorController.canEditVideo(atPath: videoPath) {
    let editController = UIVideoEditorController()
    editController.videoPath = videoPath
    editController.delegate = self
    present(editController, animated:true)
}

For more information about UIVideoEditorController, check Apple's documentation: https://developer.apple.com/documentation/uikit/uivideoeditorcontroller?



来源:https://stackoverflow.com/questions/47127659/ios-11-1-uiimagepickercontroller-video-crop-start-time-not-movable

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!