         oldValue.removeObserver(self, forKeyPath: #keyPath(AVPlayer.volume))
         oldValue.removeObserver(self, forKeyPath: #keyPath(AVPlayer.currentItem.loadedTimeRanges))
         oldValue.removeObserver(self, forKeyPath: #keyPath(AVPlayer.currentItem.duration))
+        oldValue.removeObserver(self, forKeyPath: #keyPath(AVPlayer.currentItem.currentMediaSelection))
     }
     
     public override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) {

        }
    }
    
    @IBAction func showSubtitlesMenu(_ sender: PUIButton) {
        // TODO: show subtitles menu
    }
    
    @IBAction public func togglePlaying(_ sender: Any?) {
        if isPlaying {
            pause(sender)

                self.updatePlayingState()
            } else if keyPath == #keyPath(AVPlayer.currentItem.duration) {
                self.metadataBecameAvailable()
            } else if keyPath == #keyPath(AVPlayer.currentItem.currentMediaSelection) {
                self.updateMediaSelection()
            } else {
                super.observeValue(forKeyPath: keyPath, of: object, change: change, context: context)
            }
