     // MARK: API
 
     func prepareToPlay() {
-        guard let playerItem = self.dataSource?.playerItem(in: self) else {
-            print("PlayerItem is not set")
+        guard let url = self.dataSource?.movieURL(in: self) else {
+            print("URL is not set")
             return
         }
 
-        self.player = AVPlayer(playerItem: playerItem)
-
-        for keyPath in observedKeyPaths {
-            self.player?.addObserver(self,
-                                     forKeyPath: keyPath,
-                                     options: [.new, .initial],
-                                     context: &playerObserveContext)
-        }
+        let asset = AVURLAsset(url: url, options: nil)
+        let item = AVPlayerItem(asset: asset)
+        player.replaceCurrentItem(with: item)
     }
 
     func play() {
-        if self.player?.currentItem?.status != AVPlayerItemStatus.readyToPlay {
+        if self.player.currentItem?.status != AVPlayerItemStatus.readyToPlay {
             print("Can not play")
             return
         }

    @IBAction func playButtonDidTap(_ sender: UIButton) {
        if let status = playerView.player?.timeControlStatus {
            switch status {
            case .paused: player?.play()
            case .playing: player?.pause()
            case .waitingToPlayAtSpecifiedRate: break
            }
        }



protocol MoviePlayerViewDataSource: class {
    func movieURL(in view: MoviePlayerView) -> URL
}

private var playerObserveContext = 0
