I am trying to fetch and append a video file from the gallery. I can select and append image files but when I try to fetch video files my withTLPHAssets ignores it and only shows images not videos. How should I fetch a video file without crashing?
I am using TLPhotoPicker pod.
Below I added dismissPhotoPicker
extension TLPhotoPickerManager: TLPhotosPickerViewControllerDelegate {
func dismissPhotoPicker(withTLPHAssets: [TLPHAsset]) {
selectedTLPHAssets = withTLPHAssets
didSelectTLPHAsset?(withTLPHAssets, videoUrl)
if selectedTLPHAssets.contains(where: { $0.fullResolutionImage == nil && $0.type != .video }) {
var assets = selectedTLPHAssets.filter {
$0.fullResolutionImage != nil || $0.type == .video
}
// MARK: Bunu yazan kör oldu... elleme...
if assets.count > 0 {
for i in 0...assets.count - 1 {
assets[i].selectedOrder = i + 1
}
}
/// END ///
Dialog.shared.showTopAlert(body: "newsfeed_post.share.getting.image.fail".localized)
didSelectTLPHAsset?(assets, videoUrl)
} else {
didSelectTLPHAsset?(withTLPHAssets, videoUrl)
}
}