Closed isayeter closed 1 year ago
As I understand, editFinishBlock only fires when trimming video, if you don't touch the trimming, then SDK just returns the supplied Asset directly, however in this case videoExportType = .mp4 will be also meaningless because if I choose a MOV file and not trim the video, SDK does not return a mp4 video. How to solve the problem?
Ok I have changed the editFinishBlock so that if returns nil, I'm creating mp4 converted video with another code.
vc.editFinishBlock = { [weak self] url in
//video trimmed
if let u = url {
self?.videoPicked(filePath: u, thumbnail: image)
}
//clicked directly done button without trimming
else {
self?.getUrlFromPHAsset(asset: model.asset, callBack: { url in
if url != nil {
VideoCompressHelper.shared.compressVideo(url!) { url2 in
DispatchQueue.main.async {
if let finalCompressed = url2 {
ZLPhotoManager.saveVideoToAlbum(url: finalCompressed) { [weak self] _, asset in }
self?.videoPicked(filePath: finalCompressed, thumbnail: image)
}
}
}
}
})
}
}
Issue Description
I have created a function to use your video editor:
When I call this function, after I click "Done" button in the video editor VC (without trimming any)
your SDK falls into this line this line and callbacks
editFinishBlock
block with nil url.Those are the console prints when investigation:
I couldn't understand the necessity of that line, can you please explain what is the reason?
Info
ZLPhotoBrowser version: 4.3.6 Device: iOS Simulator Device version: iOS 14.5 Xcode version: Xcode 14.0
Configuration code of
ZLPhotoConfiguration