This commit is contained in:
DDIsFriend
2023-08-29 11:04:54 +08:00
parent a57bbc0070
commit b6ef0cfb06
5 changed files with 66 additions and 90 deletions

View File

@@ -769,9 +769,10 @@ extension RescuePendingDispatchController : UICollectionViewDelegate, UICollecti
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "cell", for: indexPath) as? RescuePendingDispatchPhotoCell
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)!)
let image = DDImage.dd_thumbnailImage(forVideo: URL(string: imageUrlStr)!).dd_compress(withQulitySize: 5 * 1024)
DispatchQueue.main.async {
cell!.imageView.image = image
}