This commit is contained in:
DDIsFriend
2023-08-30 17:48:23 +08:00
parent 61ff533423
commit 456b879a00
8 changed files with 137 additions and 298 deletions

View File

@@ -792,14 +792,23 @@ extension RescuePendingDispatchController : UICollectionViewDelegate, UICollecti
let imageUrlStr = environmentPics[indexPath.item]
cell!.imageView.image = nil
if imageUrlStr.contains(".mp4?") == true {
DispatchQueue.global().async {
let image = DDImage.dd_thumbnailImage(forVideo: URL(string: imageUrlStr)!).dd_compress(withQulitySize: 5 * 1024)
DispatchQueue.main.async {
cell!.imageView.image = image
if let url = URL(string: imageUrlStr) {
DispatchQueue.global().async {
DDImage.dd_thumbnailImage(forVideo: url) { (thumbnailImage, _, _) in
let image = thumbnailImage?.dd_compress(withQulitySize: 5 * 1024)
DispatchQueue.main.async {
cell!.imageView.image = image
}
}
}
DispatchQueue.global().async {
let cmTime = TOOL.getDuration(url: url)
DispatchQueue.main.async {
cell!.dateLabel.text = TOOL.getVideoDateString(duration: Int(cmTime.seconds))
}
}
}
let cmTime = TOOL.getDuration(url: URL(string: imageUrlStr)!)
cell!.dateLabel.text = TOOL.getVideoDateString(duration: Int(cmTime.seconds))
}else{
cell!.imageView.sd_setImage(with: URL(string: imageUrlStr))
cell!.dateLabel.text = nil