         
         if currentIndexPath == indexPath {
             // 当前cell需要播放视屏
-            if view as? BMPlayer == nil {
+            if (view as? BMPlayer) == nil {
                 videoCell.bgView.addSubview(player)
                 player.frame = videoCell.videoFrame
             }

    }
    
    func tableView(_ tableView: UITableView, willDisplay cell: UITableViewCell, forRowAt indexPath: IndexPath) {
        let playerCell = tableView.cellForRow(at: currentIndexPath)
        if let playerCell = playerCell, tableView.visibleCells.contains(playerCell) {
            player.play()
        } else {
            player.pause()
        }
        guard let videoCell = cell as? VideoCell else {
            return
        }

                playerV.removeFromSuperview()
            }
        }
        
        if let visibleIndexPath = tableView.indexPathsForVisibleRows, visibleIndexPath.contains(currentIndexPath) {
            if !player.isPlaying {
                player.play()
            }
        } else {
            player.pause()
        }
    }
}

// MARK: - UITableViewDataSource
