I am using FDTake (the pod wont be too important for this question but still) to select videos from Photos which works fine. However, I would also like to be able to edit videos and limit their length to about 12 seconds. To do so I looked at the code of the pod and changed line 271 to self.imagePicker.allowsEditing = true
which already causes the problem I haven't been able to solve so far: The left slider's touch (box) is “off”. Since that's a rather vague description I uploaded a video and you can find it right here.
Unfortunately, I have absolutely no idea what engenders the problem and would really appreciate some help with this. I asked the creator of FDTake but apparently he thinks that Apple needs to fix this (as you'll be able to see in one of the latest closed issues).
Can someone explain how I can fix this and what is causing it?
We've had the same problem here. It certainly has to do with gestures on the left side of the screen.
When you add
additionalSafeAreaInsets
to yourUIImagePickerController
it works much better.This is what we tried:
We ended up using the
UIVideoEditorController
.One possible Solution: Select the video and then trim the video using PryntTrimmerView
You can use PryntTrimmerView library for trimming the videos. I have implemented this library in a sample project. You can download the running sample project from my github repo Here
The load random video button loads a random video from device's storage (photos). Therefore atleast one video file needs to be present
An Avplayer is being used for displaying the video
This is complete video
Trimming the Video
Note: : Minimum Allowed distance between handles is specified in
PryntTrimmerView.swift
file using a private property.And this function uses this property along with video duration and frame to calculate minimum distance bw handles
Let me know if you encounter any problems or need more information
Thanks
I've reproduced the issue using an
UIImagePickerController
directly.Here is some code that you can call from your viewController:
My guess is that there is a gesture conflict with some internal view only on the left side of the screen, once you've pulled the left handle somewhere in the middle, you can access it directly.
Also, this does not seem to be new: IOS 11 UIImagepicker for video how to move the slider to the bottom?
The best thing you can do is to file a radar to Apple.
In the meantime, you can use the library suggested by Awais Fayyaz as a workaround. (Disclaimer: I'm the author of the library, so I am biased of course). Another option would be to use an
UIVideoEditorController
once the user has selected the video, that component does not have any issue on iOS 11.