 
     @IBOutlet var tableView: UITableView!
     @IBOutlet var videoPlayer: SHVideoPlayer!
-    fileprivate var videos: [SHVideo] = VideoDataSource.getModel()
+    fileprivate var videos: [SHVideo?] = VideoDataSource.getModel()
     
     override func viewDidLoad() {
         super.viewDidLoad()

    
    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
        let cell = tableView.dequeueReusableCell(withIdentifier: "VideoTableViewCellID", for: indexPath) as! VideoTableViewCell
        let video = videos[indexPath.row]
        cell.titleLabel.text = video.title
        cell.sourceURLLabel.text = video.sourceURL
        cell.thumbImageView.image = video.thumbImage
        return cell
    }
}

    
    override func viewDidAppear(_ animated: Bool) {
        super.viewDidAppear(animated)
        guard let video = videos[1] else {
            return
        }
        videoPlayerPlayVideo(video: video)
    }
    
    fileprivate func videoPlayerPlayVideo(video: SHVideo) {
        guard let sourceURL = video.sourceURL else {
            return
        }
        
        guard let url =  URL(string: sourceURL),
            let title = video.title else {
                return
        }
        videoPlayer.playWithURL(url, title: title)
    }
}

