|
@@ -794,11 +794,22 @@ class CommunityVideoCoverCollectionCell: UICollectionViewCell {
|
|
|
let doubleHeight = Double(heightStr)
|
|
|
let fHeight = CGFloat(doubleHeight ?? 0)
|
|
|
|
|
|
- let vHeight = kScreenWidth/fWidth*fHeight
|
|
|
- self.videoPlayView.snp.remakeConstraints { (make) in
|
|
|
- make.left.right.equalToSuperview()
|
|
|
- make.centerY.equalToSuperview()
|
|
|
- make.height.equalTo(vHeight)
|
|
|
+ let videoRatio : CGFloat = fHeight/fWidth
|
|
|
+ let screenRatio: CGFloat = kScreenHeight/kScreenWidth
|
|
|
+ if videoRatio > screenRatio {
|
|
|
+ let vWidth = kScreenHeight/fHeight*fWidth
|
|
|
+ self.videoPlayView.snp.remakeConstraints { (make) in
|
|
|
+ make.top.bottom.equalToSuperview()
|
|
|
+ make.centerX.equalToSuperview()
|
|
|
+ make.width.equalTo(vWidth)
|
|
|
+ }
|
|
|
+ } else{
|
|
|
+ let vHeight = kScreenWidth/fWidth*fHeight
|
|
|
+ self.videoPlayView.snp.remakeConstraints { (make) in
|
|
|
+ make.left.right.equalToSuperview()
|
|
|
+ make.centerY.equalToSuperview()
|
|
|
+ make.height.equalTo(vHeight)
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|