|
@@ -234,10 +234,26 @@ extension TSAIPhotoBrowseVC:UICollectionViewDataSource,UICollectionViewDelegate
|
|
|
}
|
|
|
|
|
|
func collectionView(_ collectionView: UICollectionView, willDisplay cell: UICollectionViewCell, forItemAt indexPath: IndexPath) {
|
|
|
- guard let cell = cell as? TSAIPhotoBrowseCell else { return }
|
|
|
-
|
|
|
if let model = dataModelArray.safeObj(At: indexPath.item){
|
|
|
- cell.model = model
|
|
|
+ if model.isVideo {
|
|
|
+ guard let cell = cell as? TSAIVideoBrowseCell else { return }
|
|
|
+ cell.model = model
|
|
|
+ }else{
|
|
|
+ guard let cell = cell as? TSAIPhotoBrowseCell else { return }
|
|
|
+ cell.model = model
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ func collectionView(_ collectionView: UICollectionView,
|
|
|
+ didEndDisplaying cell: UICollectionViewCell,
|
|
|
+ forItemAt indexPath: IndexPath) {
|
|
|
+
|
|
|
+ if let model = dataModelArray.safeObj(At: indexPath.item){
|
|
|
+ if model.isVideo {
|
|
|
+ guard let cell = cell as? TSAIVideoBrowseCell else { return }
|
|
|
+ cell.videoPlayerVC?.playPause()
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|