                 let navigationBarHeight = navigationController?.navigationBar.bounds.height ?? 0
                 if visibleHeight - navigationBarHeight > cellHeigt * 0.6 {
                     isPlayingCellFound = true
-                    player?.play()
+                    playVideoAtIndexPath(indexPath)
                 } else {
-                    player?.stop()
+                    stopVideoPlayingAtIndexPath(indexPath)
                 }
             }
         }

    override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell
    {
        let cell = tableView.dequeueReusableCellWithIdentifier("VideoTableViewCell", forIndexPath: indexPath) as! VideoTableViewCell
        let videoUrl = videoUrls[indexPath.row]

        let vodItem = VODItem()
        vodItem.contentVideoUrl = videoUrl
        
        let player = players[indexPath] ?? ANPlayerController()
        players[indexPath] = player
        player.view.removeFromSuperview()
        cell.videoContainerView.addSubview(player.view)
        player.view.frame = cell.videoContainerView.bounds
        player.controlsView = ANPlayerControlsView.createFromNib()
        player.view.snp_makeConstraints { (make) -> Void in
            make.top.equalTo(cell.videoContainerView.snp_top)
            make.bottom.equalTo(cell.videoContainerView.snp_bottom)
            make.left.equalTo(cell.videoContainerView.snp_left)
            make.right.equalTo(cell.videoContainerView.snp_right)
        }
        
        player.playable = vodItem
        player.prepare()
   
        return cell
    }
    
    override func tableView(tableView: UITableView, didEndDisplayingCell cell: UITableViewCell, forRowAtIndexPath indexPath: NSIndexPath)
    {
        let player = players[indexPath]
        player?.stop()
    }
    
    // MARK: - UIScrollViewDelegate

    
    // MARK: - Private
    
    private func playVideoAtIndexPath(indexPath: NSIndexPath)
    {
        if let currentPlayingIndexPath = currentPlayingIndexPath where indexPath == currentPlayingIndexPath { return }
        
        let cell = tableView.cellForRowAtIndexPath(indexPath) as! VideoTableViewCell
        
        player.view.removeFromSuperview()
        cell.videoContainerView.addSubview(player.view)
        player.view.snp_makeConstraints { (make) -> Void in
            make.top.equalTo(cell.videoContainerView.snp_top)
            make.bottom.equalTo(cell.videoContainerView.snp_bottom)
            make.left.equalTo(cell.videoContainerView.snp_left)
            make.right.equalTo(cell.videoContainerView.snp_right)
        }
        
        let videoUrl = videoUrls[indexPath.row]
        let vodItem = VODItem()
        vodItem.contentVideoUrl = videoUrl
        
        currentPlayingIndexPath = indexPath
        
        player.playable = vodItem
        player.prepare()
        player.play()
    }
    
    private func stopVideoPlayingAtIndexPath(indexPath: NSIndexPath)
    {
        let cell = tableView.cellForRowAtIndexPath(indexPath) as! VideoTableViewCell
        if cell.videoContainerView.subviews.contains(player.view) {
            player.view.removeFromSuperview()
        }
    }
    
    private func onScrollViewEndScrolling()
    {
        var isPlayingCellFound = false
        for cell in tableView.visibleCells {
            if let indexPath = tableView.indexPathForCell(cell) {
                if isPlayingCellFound {
                    stopVideoPlayingAtIndexPath(indexPath)
                    continue
                }
                
