浏览代码

1.修改播放器裁剪模式

wenweiwei 3 年之前
父节点
当前提交
772b0d1d13

+ 11 - 7
MusicVideoPlus/Classes/Modules/Mine/Controllers/MVPlayViewController.swift

@@ -154,14 +154,14 @@ extension MVPlayViewController: UICollectionViewDelegate, UICollectionViewDataSo
             return
         }
         let indexPath = collectionView.indexPath(for: cell!)
-        if currentIndex != nil, currentIndex?.item == indexPath?.item {
-            PQSingletoVideoPlayer.shared.resumePlayer()
-            return
-        }
+//        if currentIndex != nil, currentIndex?.item == indexPath?.item {
+//            PQSingletoVideoPlayer.shared.resumePlayer()
+//            return
+//        }
         currentIndex = indexPath
-        var itemData = itemsList[indexPath?.item ?? 0]
+        let itemData = itemsList[indexPath?.item ?? 0]
         itemData.playProgress = 0
-        PQSingletoVideoPlayer.shared.configPlyer(videoData: itemData, controllerView: cell!.coverImageView)
+        PQSingletoVideoPlayer.shared.configPlyer(videoData: itemData, controllerView: cell!.coverImageView, renderMode: .RENDER_MODE_FILL_EDGE)
         PQSingletoVideoPlayer.shared.resetPlayer()
     }
 
@@ -253,7 +253,7 @@ extension MVPlayViewController: UICollectionViewDelegate, UICollectionViewDataSo
         let navVc: UINavigationController? = (UIApplication.shared.keyWindow?.rootViewController) as? UINavigationController
         if navVc?.visibleViewController is MVPlayViewController {
             (collectionView.visibleCell() as? MVPlayControlViewCell)?.pauseBtn.isSelected = true
-            PQSingletoVideoPlayer.shared.stopPlayer(isRemove:false)
+            PQSingletoVideoPlayer.shared.stopPlayer(isRemove: false)
         }
     }
 
@@ -265,4 +265,8 @@ extension MVPlayViewController: UICollectionViewDelegate, UICollectionViewDataSo
             PQSingletoVideoPlayer.shared.startPlayr()
         }
     }
+
+    override open var preferredStatusBarStyle: UIStatusBarStyle {
+        return .lightContent
+    }
 }

+ 3 - 2
MusicVideoPlus/Classes/Modules/Mine/Views/MVPlayControlViewCell.swift

@@ -13,10 +13,11 @@ class MVPlayControlViewCell: UICollectionViewCell {
     var btnClickHandle: ((_ sender: UIButton, _ videoData: PQVideoListModel?) -> Void)?
     lazy var coverImageView: UIImageView = {
         let coverImageView = UIImageView()
-        coverImageView.contentMode = .scaleAspectFill
+        coverImageView.contentMode = .scaleAspectFit
+        coverImageView.clipsToBounds = true
         coverImageView.isUserInteractionEnabled = true
         coverImageView.tag = cCellTag
-        coverImageView.backgroundColor = UIColor.white
+        coverImageView.backgroundColor = UIColor.black
         let ges = UITapGestureRecognizer(target: self, action: #selector(tagClick))
         coverImageView.addGestureRecognizer(ges)
         return coverImageView