iOS 11.1 UIImagePickerController视频裁剪开始时间无法移动 [英] iOS 11.1 UIImagePickerController video crop start time not movable

查看:345
本文介绍了iOS 11.1 UIImagePickerController视频裁剪开始时间无法移动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在显示一个UIImagePickerController供用户选择(并裁剪)要在我们的应用中使用的视频.最近,用户在尝试裁剪视频时遇到了问题,开始时间手柄几乎变得无法拖动.

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.

我认为这与为iPhone X添加的新通知中心手势有关.我相信这个问题

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.

还有其他人遇到此问题,或者有解决该问题的方法吗?由于这是一个库存的UIViewController,因此我不了解如何在不构建自己的自定义视频选择器/裁剪器的情况下解决该问题.

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.

推荐答案

我遇到了同样的问题,因此决定禁用UIImagePickerController编辑,并在UIImagePIckerController的didFinishPickingMediaWithInfo中捕获视频路径,然后使用UIVideoEditorController编辑视频.这是一个简单的示例:

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)
}

有关UIVideoEditorController的更多信息,请查看Apple的文档: https://developer.apple.com/documentation/uikit/uivideoeditorcontroller ?

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

这篇关于iOS 11.1 UIImagePickerController视频裁剪开始时间无法移动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆