IOS 11 UIImagepicker for video how to move the slider to the bottom?

房东的猫 提交于 2019-12-13 03:07:02

问题


If UIImagepicker with mediatype set to video and allowsEditing to true, the slider on the top ist not touchable on the left side. So i cant crop the beginning of the video.

Its working in IOS10 perfectly, but in iOS11 it seams to be buggy.

How to move the slider to the bottom, like Apple did in Photos?

This is my code:

class func shouldStartVideoLibrary(_ target: AnyObject, canEdit: Bool) -> Bool {
    if !UIImagePickerController.isSourceTypeAvailable(UIImagePickerControllerSourceType.photoLibrary) && !UIImagePickerController.isSourceTypeAvailable(UIImagePickerControllerSourceType.savedPhotosAlbum) {
        return false
    }

    let type = kUTTypeMovie as String
    let imagePicker = UIImagePickerController()

    if UIImagePickerController.isSourceTypeAvailable(UIImagePickerControllerSourceType.photoLibrary) && (UIImagePickerController.availableMediaTypes(for: UIImagePickerControllerSourceType.photoLibrary) as [String]!).contains(type) {
        imagePicker.mediaTypes = [type]
        imagePicker.sourceType = UIImagePickerControllerSourceType.photoLibrary
    }
    else if UIImagePickerController.isSourceTypeAvailable(UIImagePickerControllerSourceType.savedPhotosAlbum) && (UIImagePickerController.availableMediaTypes(for: UIImagePickerControllerSourceType.savedPhotosAlbum) as [String]!).contains(type) {
        imagePicker.mediaTypes = [type]
        imagePicker.sourceType = UIImagePickerControllerSourceType.savedPhotosAlbum
    }
    else {
        return false
    }

    imagePicker.allowsEditing = canEdit
    imagePicker.videoMaximumDuration = 240.0
    imagePicker.delegate = target as! ChatViewController
    target.present(imagePicker, animated: true, completion: nil)

    return true
}

来源:https://stackoverflow.com/questions/46599970/ios-11-uiimagepicker-for-video-how-to-move-the-slider-to-the-bottom

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