Browse Source

no message

南鑫林 5 years ago
parent
commit
7aae1aee21

+ 1 - 0
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityRecommendDetail/View/CommunityPostDetailFSPagerViewCell.swift

@@ -49,6 +49,7 @@ class CommunityPostDetailFSPagerViewCell: FSPagerViewCell {
         let bgImageView = UIImageView()
         bgImageView.isUserInteractionEnabled = true
         bgImageView.image = kImage(name: "pic_preload")
+        bgImageView.contentMode = .scaleAspectFit
         return bgImageView
     }()
     

+ 10 - 10
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityVideoContent/View/CommunityVideoCoverCollectionCell.swift

@@ -69,7 +69,7 @@ class CommunityVideoCoverCollectionCell: UICollectionViewCell {
         
         // 视频播放
         addSubview(videoPlayView)
-        videoPlayView.addTapGesture(1, target: self, action: #selector(videoTapAction))
+//        videoPlayView.addTapGesture(1, target: self, action: #selector(videoTapAction))
         addSubview(bottomSepView)
         addSubview(bgView)
         
@@ -84,7 +84,7 @@ class CommunityVideoCoverCollectionCell: UICollectionViewCell {
         
         // 底部渐变
         addSubview(bottomGradientView)
-        bottomGradientView.addTapGesture(1, target: self, action: #selector(videoTapAction))
+//        bottomGradientView.addTapGesture(1, target: self, action: #selector(videoTapAction))
         
         // 底部
         bottomGradientView.addSubview(bottomCommentView)
@@ -371,7 +371,7 @@ class CommunityVideoCoverCollectionCell: UICollectionViewCell {
     }()
     
     // MARK: 视频播放View
-    private lazy var videoPlayView: CommunityVideoPlayView = {
+    lazy var videoPlayView: CommunityVideoPlayView = {
         let videoPlayView = CommunityVideoPlayView()
         videoPlayView.isUserInteractionEnabled = true
         return videoPlayView
@@ -706,13 +706,13 @@ class CommunityVideoCoverCollectionCell: UICollectionViewCell {
         videoPlayView.pause()
     }
     
-    @objc func videoTapAction(_ tap: UITapGestureRecognizer?) {
-        if videoPlayView.pauseFlag {
-            self.play()
-        } else {
-            self.pause()
-        }
-    }
+//    @objc func videoTapAction(_ tap: UITapGestureRecognizer?) {
+//        if videoPlayView.pauseFlag {
+//            self.play()
+//        } else {
+//            self.pause()
+//        }
+//    }
     
     var videoItemMdl: CommunityVideoItemModel? {
         didSet {

+ 8 - 1
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityVideoContent/ViewController/CommunityVideoListController.swift

@@ -209,7 +209,14 @@ extension CommunityVideoListController: UICollectionViewDelegateFlowLayout,UICol
     }
     
     func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
-        print("----collectionClicked -- \(indexPath.row)")
+        let cell = collectionView.cellForItem(at: indexPath) as? CommunityVideoCoverCollectionCell
+        if cell != nil {
+            if (cell?.videoPlayView.pauseFlag)! {
+                cell?.play()
+            } else {
+                cell?.pause()
+            }
+        }
     }