|
@@ -744,6 +744,24 @@ class CommunityVideoCoverCollectionCell: UICollectionViewCell {
|
|
|
return playStatusImageView
|
|
|
}()
|
|
|
|
|
|
+ // 无数据のtipBackView
|
|
|
+ lazy var tipBackView: UIView = {
|
|
|
+ let tipBackView = UIView()
|
|
|
+ tipBackView.cornerRadius = 8
|
|
|
+ tipBackView.masksToBounds = true
|
|
|
+ tipBackView.backgroundColor = kRGBAColor(r: 0, g: 0, b: 0, a: 0.5)
|
|
|
+ return tipBackView
|
|
|
+ }()
|
|
|
+
|
|
|
+ // 无数据のtipLabel
|
|
|
+ private lazy var tipLabel: UILabel = {
|
|
|
+ let tipLabel = UILabel()
|
|
|
+ tipLabel.text = "视频不见了"
|
|
|
+ tipLabel.textColor = kffffffColor
|
|
|
+ tipLabel.font = kRegularFont15
|
|
|
+ return tipLabel
|
|
|
+ }()
|
|
|
+
|
|
|
|
|
|
// MARK: - 播放动作
|
|
|
func play() {
|
|
@@ -758,6 +776,39 @@ class CommunityVideoCoverCollectionCell: UICollectionViewCell {
|
|
|
|
|
|
var videoItemMdl: CommunityVideoItemModel? {
|
|
|
didSet {
|
|
|
+ // 数据不存在
|
|
|
+ if self.videoItemMdl?.id == nil {
|
|
|
+ self.backgroundColor = kffffffColor
|
|
|
+
|
|
|
+ // 添加毛玻璃效果,需使用frame设置位置
|
|
|
+ let blurEffect = UIBlurEffect(style: .dark)
|
|
|
+ let blurEffectView = UIVisualEffectView(effect: blurEffect)
|
|
|
+ blurEffectView.frame = CGRect(x: CGFloat(0), y: 0, width: kScreenWidth, height: kScreenHeight)
|
|
|
+ addSubview(blurEffectView)
|
|
|
+
|
|
|
+ navBackBtn.snp.makeConstraints { (make) in
|
|
|
+ make.left.equalTo(5)
|
|
|
+ make.top.equalTo(kSafeStatusBarHeight+2)
|
|
|
+ make.size.equalTo(40)
|
|
|
+ }
|
|
|
+ bringSubviewToFront(navBackBtn)
|
|
|
+
|
|
|
+ addSubview(tipBackView)
|
|
|
+ tipBackView.snp.makeConstraints { (make) in
|
|
|
+ make.center.equalToSuperview()
|
|
|
+ make.width.equalTo(120)
|
|
|
+ make.height.equalTo(60)
|
|
|
+ }
|
|
|
+
|
|
|
+ tipBackView.addSubview(tipLabel)
|
|
|
+ tipLabel.snp.makeConstraints { (make) in
|
|
|
+ make.center.equalToSuperview()
|
|
|
+ }
|
|
|
+
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ // 根据视频数据填充UI
|
|
|
if !(self.videoItemMdl?.video == nil || self.videoItemMdl?.video == "") {
|
|
|
videoPlayView.assetURLString = self.videoItemMdl?.video
|
|
|
}
|