     }
     
     private func videoInfoCount() -> Int {
-        switch viewData {
+        switch viewData.value {
         case .loaded(let infos): return infos.count
         default: return 0
         }

        let videoInfo = videoViewController.videoInfo
        guard let nextVideoInfo = videoInfoAfter(videoInfo) else { return nil }
        let newViewController = VideoViewController(videoInfo: nextVideoInfo, client: client)
        return newViewController
    }
    

        let videoInfo = videoViewController.videoInfo
        guard let previousVideoInfo = videoInfoBefore(videoInfo) else { return nil }
        let newViewController = VideoViewController(videoInfo: previousVideoInfo, client: client)
        newViewController.viewState.swap(.inactive)
        newViewController.userPlayState.swap(userPlayState.value)
        return newViewController
    }
    
    func pageViewController(_ pageViewController: UIPageViewController, willTransitionTo pendingViewControllers: [UIViewController]) {
        guard let videoViewController = pendingViewControllers.first as? VideoViewController else { return }
        videoViewController.viewState.swap(.mayBecomeActive)
        videoViewController.userPlayState.swap(userPlayState.value)
    }
    
    func pageViewController(_ pageViewController: UIPageViewController, didFinishAnimating finished: Bool, previousViewControllers: [UIViewController], transitionCompleted completed: Bool) {
        if let previousVideoViewController = previousViewControllers.first as? VideoViewController {
            previousVideoViewController.viewState.swap(.inactive)
            previousVideoViewController.userPlayState.swap(userPlayState.value)
        }
        
        if let currentVideoViewController = self.viewControllers?.first as? VideoViewController  {
            currentVideoViewController.viewState.swap(.active)
            currentVideoViewController.userPlayState.swap(userPlayState.value)
        }
    }
    
