|
@@ -491,30 +491,28 @@ extension MVHomeController: UICollectionViewDelegate, UICollectionViewDataSource
|
|
|
return CGSize(width: width, height: collectionView.frame.height - 14)
|
|
|
}
|
|
|
|
|
|
- func collectionView(_: UICollectionView, didSelectItemAt _: IndexPath) {
|
|
|
-// for hot in mVideos {
|
|
|
-// hot.isSelected = false
|
|
|
-// }
|
|
|
-//
|
|
|
-// let itemDataNew: MVHotVideoModel = mVideos[indexPath.item]
|
|
|
-// itemDataNew.isSelected = true
|
|
|
-// categoryCollectionView.reloadData()
|
|
|
-//
|
|
|
-// // 找出当前选择分类之前的视频数量和
|
|
|
-// var videosCount: Int = 0
|
|
|
-// if indexPath.row != 0 {
|
|
|
-// for i in 0 ... indexPath.row - 1 {
|
|
|
-// videosCount = videosCount + mVideos[i].videos.count
|
|
|
-// }
|
|
|
-// BFLog(message: "indexPath 选择\(indexPath.item) 之前的视频合\(videosCount)")
|
|
|
-// }
|
|
|
-// viewListView.currentIndex = videosCount
|
|
|
-// viewListView.scrollToItem(at: videosCount, animated: false)
|
|
|
-//
|
|
|
-// DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 0.05) {
|
|
|
-// self.playVideo(page: videosCount)
|
|
|
-// }
|
|
|
- let vc = MVPlayViewController()
|
|
|
- navigationController?.pushViewController(vc, animated: true)
|
|
|
+ func collectionView(_: UICollectionView, didSelectItemAt indexPath: IndexPath) {
|
|
|
+ for hot in mVideos {
|
|
|
+ hot.isSelected = false
|
|
|
+ }
|
|
|
+
|
|
|
+ let itemDataNew: MVHotVideoModel = mVideos[indexPath.item]
|
|
|
+ itemDataNew.isSelected = true
|
|
|
+ categoryCollectionView.reloadData()
|
|
|
+
|
|
|
+ // 找出当前选择分类之前的视频数量和
|
|
|
+ var videosCount: Int = 0
|
|
|
+ if indexPath.row != 0 {
|
|
|
+ for i in 0 ... indexPath.row - 1 {
|
|
|
+ videosCount = videosCount + mVideos[i].videos.count
|
|
|
+ }
|
|
|
+ BFLog(message: "indexPath 选择\(indexPath.item) 之前的视频合\(videosCount)")
|
|
|
+ }
|
|
|
+ viewListView.currentIndex = videosCount
|
|
|
+ viewListView.scrollToItem(at: videosCount, animated: false)
|
|
|
+
|
|
|
+ DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 0.05) {
|
|
|
+ self.playVideo(page: videosCount)
|
|
|
+ }
|
|
|
}
|
|
|
}
|