     }
     
     func windowWillClose(note: NSNotification!) {
-        player?.cancelPendingPrerolls()
-        player?.pause()
+        if let player = player {
+            player.cancelPendingPrerolls()
+            player.pause()
+            removeRateObserver(player: player)
+        }
         asset = nil
         item = nil
         player = nil

                dispatch_async(dispatch_get_main_queue()) {
                    self.progressIndicator.stopAnimation(nil)
                    self.player?.play()
                }
            }
        } else {

    
    private func playEventVideo(url: NSURL) {
        player = AVPlayer(URL: url)
        addRateObserver(player: player!)
        progressIndicator.stopAnimation(nil)
        playerView.player = player
    }
    
    var rate: Float = 1.0
    
    private func addRateObserver(player player: AVPlayer) {
        player.addObserver(self, forKeyPath: "rate", options: [.New, .Old], context: nil)
    }

    private func removeRateObserver(player player: AVPlayer) {
        player.removeObserver(self, forKeyPath: "rate")
    }
    
    override func observeValueForKeyPath(keyPath: String?, ofObject object: AnyObject?, change: [String : AnyObject]?, context: UnsafeMutablePointer<Void>) {
