s
This commit is contained in:
parent
94588c4e89
commit
591784a9ec
Binary file not shown.
@ -399,9 +399,6 @@ class CCSpaceAlbumFilterPopView2: UIView {
|
|||||||
|
|
||||||
extension CCSpaceAlbumFilterPopView2:UICollectionViewDataSource, UICollectionViewDelegateFlowLayout {
|
extension CCSpaceAlbumFilterPopView2:UICollectionViewDataSource, UICollectionViewDelegateFlowLayout {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// MARK: - UICollectionViewDataSource
|
// MARK: - UICollectionViewDataSource
|
||||||
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
|
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
|
||||||
return self.dataSource.count
|
return self.dataSource.count
|
||||||
@ -424,14 +421,11 @@ extension CCSpaceAlbumFilterPopView2:UICollectionViewDataSource, UICollectionVie
|
|||||||
|
|
||||||
let time:Double = Double(model.itemAsset!.duration)
|
let time:Double = Double(model.itemAsset!.duration)
|
||||||
let timeStr:String = ZZHHelper.formatVideoTime(second:Int(time))
|
let timeStr:String = ZZHHelper.formatVideoTime(second:Int(time))
|
||||||
// let timeStr:String = self.transToHourMinSec(second:Int(time))
|
|
||||||
|
|
||||||
cell.frameCountLabel.isHidden = true
|
cell.frameCountLabel.isHidden = true
|
||||||
cell.timeLabel.isHidden = false
|
cell.timeLabel.isHidden = false
|
||||||
cell.timeLabel.text = timeStr
|
cell.timeLabel.text = timeStr
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return cell
|
return cell
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -494,10 +488,8 @@ extension CCSpaceAlbumFilterPopView2:UICollectionViewDataSource, UICollectionVie
|
|||||||
|
|
||||||
//MARK: - 获取图片data
|
//MARK: - 获取图片data
|
||||||
private func getImageData(for asset: PHAsset) -> Data? {
|
private func getImageData(for asset: PHAsset) -> Data? {
|
||||||
|
|
||||||
var imageData: Data?
|
var imageData: Data?
|
||||||
if asset.mediaType == .image {
|
if asset.mediaType == .image {
|
||||||
|
|
||||||
let requestOptions = PHImageRequestOptions()
|
let requestOptions = PHImageRequestOptions()
|
||||||
requestOptions.isSynchronous = true//设置成同步回调
|
requestOptions.isSynchronous = true//设置成同步回调
|
||||||
requestOptions.deliveryMode = .highQualityFormat
|
requestOptions.deliveryMode = .highQualityFormat
|
||||||
@ -505,13 +497,10 @@ extension CCSpaceAlbumFilterPopView2:UICollectionViewDataSource, UICollectionVie
|
|||||||
imageData = data
|
imageData = data
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
print(".....:\(imageData)")
|
|
||||||
return imageData
|
return imageData
|
||||||
}
|
}
|
||||||
|
|
||||||
private func getVideoURL(from asset: PHAsset, completion: @escaping (URL,AVURLAsset) -> Void) {
|
private func getVideoURL(from asset: PHAsset, completion: @escaping (URL,AVURLAsset) -> Void) {
|
||||||
|
|
||||||
if asset.mediaType == .video {
|
if asset.mediaType == .video {
|
||||||
let requestOptions = PHVideoRequestOptions()
|
let requestOptions = PHVideoRequestOptions()
|
||||||
requestOptions.isNetworkAccessAllowed = true
|
requestOptions.isNetworkAccessAllowed = true
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user