 
         debugLog("playing next video for player \(player)");
         
+
+    }
+    
+    // MARK: - Playing Videos
+    
+    func playNextVideo() {
+        
+        let player = AVPlayer()
         // play another video
-        playNextVideo(player);
-    }
-    
-    // MARK: - Playing Videos
-    
-    func playNextVideo(player:AVPlayer) {
+        let oldPlayer = self.player
+        self.player = player
+        self.playerView.player = self.player
+        
+        if (oldPlayer == AerialView.previewPlayer) {
+            AerialView.previewPlayer = self.player
+        }
+        
+        
         let randomVideo = ManifestLoader.instance.randomVideo();
         
         guard let video = randomVideo else {

    
    func playerItemFailedtoPlayToEnd(aNotification: NSNotification) {
        NSLog("AVPlayerItemFailedToPlayToEndTimeNotification \(aNotification)");
        guard let player = self.player else {
            return;
        }
        
        playNextVideo(player);
    }
    
    func playerItemNewErrorLogEntryNotification(aNotification: NSNotification) {

            return;
        }
        let videoURL = video.url;
        
        let asset = CachedOrCachingAsset(videoURL)
//        let asset = AVAsset(URL: videoURL);
        
        let item = AVPlayerItem(asset: asset);
        
        player.replaceCurrentItemWithPlayerItem(item);
        
        debugLog("playing video: \(video.url)");
