update
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user