 extension SelfieViewController: UITableViewDelegate {
     func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
         tableView.deselectRow(at: indexPath, animated: false)
+        currentIndexPath = indexPath
         let videoModel = videos[indexPath.row]
         playerInfo.title = videoModel.title
         playerInfo.cover = videoModel.img
         if let cell = tableView.cellForRow(at: indexPath) as? VideoCell {
-            currentIndexPath = indexPath
             player.prepareToDealloc()
             player.removeFromSuperview()
             cell.bgView.addSubview(player)

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

extension SelfieViewController: BMPlayerDelegate {
    // Call back when playing state changed, use to detect is playing or not
    func bmPlayer(player: BMPlayer, playerIsPlaying playing: Bool) {
    }
    
    // Call back when playing state changed, use to detect specefic state like buffering, bufferfinished
    func bmPlayer(player: BMPlayer, playerStateDidChange state: BMPlayerState) {
    }
    
    // Call back when play time change
    func bmPlayer(player: BMPlayer, playTimeDidChange currentTime: TimeInterval, totalTime: TimeInterval) {
    }
    
    // Call back when the video loaded duration changed
    func bmPlayer(player: BMPlayer, loadedTimeDidChange loadedDuration: TimeInterval, totalDuration: TimeInterval) {
    }
}

