0

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
}
Skyborg
  • 854
  • 13
  • 13
  • Would recommend you to file this as a bug with regards to my (https://stackoverflow.com/questions/48995765/range-sliders-touch-box-of-video-trimmer-off?noredirect=1&lq=1) and this question (https://stackoverflow.com/questions/144873/can-i-browse-other-peoples-apple-bug-reports). – Moritz May 15 '18 at 18:22
  • 1
    I reported it in Oct 2017, with possible duplication of this bug. i cant see whats happening,but they know it. Until now the bug is still there :( Maybee IOS12 will fix it. – Skyborg Aug 28 '18 at 11:18
  • 1
    I did, too. I don't know if anything's happened since then. Nonetheless, there is an awesome library on github you may use: https://github.com/Yummypets/YPImagePicker. Editing is way easier (tip, cause I didn't notice first: for videos longer than one's max duration one needs to scroll along the horizontal axis when trimming), one can even choose an individual thumbnail and it may also be used to pick photos! Highly recommend! – Moritz Aug 28 '18 at 17:23
  • Thank you @Moritz the picker looks nice. i will give it a try. – Skyborg Sep 05 '18 at 05:50

0 Answers0