     }
     
     public override func observeValueForKeyPath(keyPath: String?, ofObject object: AnyObject?,
-        change: [String : AnyObject]?, context: UnsafeMutablePointer<Void>) {
-            switch context {
-            case &kvoStatusDidChangeContext:
-                handleStatusChangedEvent()
-            case &kvoTimeRangesContext:
-                handleTimeRangesEvent()
-            case &kvoBufferingContext:
-                handleBufferingEvent(keyPath!)
-            default:
-                break
-            }
-    }
-    
-    public override func setSubtitle(subtitleOption: AVMediaSelectionOption) {
-        setMediaSelectionOption(subtitleOption, characteristic: AVMediaCharacteristicLegible)
-    }
-    
-    public override func setAudioSource(audioOption: AVMediaSelectionOption) {
-        setMediaSelectionOption(audioOption, characteristic: AVMediaCharacteristicAudible)
-    }
-    
-    private func setMediaSelectionOption(option: AVMediaSelectionOption,  characteristic: String) {
-        if self.player != nil {
-            if let group = mediaSelectionGroup(characteristic) {
-                self.player.currentItem?.selectMediaOption(option, inMediaSelectionGroup: group)
-            }
-        }
-    }
-    
-    public override func subtitles() -> [AVMediaSelectionOption]? {
-        return mediaSelectionGroup(AVMediaCharacteristicLegible)?.options
-    }
-    
-    public override func audioSources() -> [AVMediaSelectionOption]? {
-        return mediaSelectionGroup(AVMediaCharacteristicAudible)?.options
-    }
-    
-    private func mediaSelectionGroup(characteristic: String) -> AVMediaSelectionGroup? {
-        guard self.player != nil else {
-            return nil
-        }
-        
-        return self.player.currentItem?.asset.mediaSelectionGroupForMediaCharacteristic(characteristic)
+                                                change: [String : AnyObject]?, context: UnsafeMutablePointer<Void>) {
+        switch context {
+        case &kvoStatusDidChangeContext:
+            handleStatusChangedEvent()
+        case &kvoTimeRangesContext:
+            handleTimeRangesEvent()
+        case &kvoBufferingContext:
+            handleBufferingEvent(keyPath!)
+        default:
+            break
+        }
     }
     
     private func updateState(newState: PlaybackState) {

    }
    
    private func handleTimeRangesEvent() {
        guard let timeRange = player.currentItem?.loadedTimeRanges.first?.CMTimeRangeValue else {
            return
        }
        

        }
    }
    
    public override func setSubtitle(subtitleOption: AVMediaSelectionOption) {
        setMediaSelectionOption(subtitleOption, characteristic: AVMediaCharacteristicLegible)
    }
    
    public override func setAudioSource(audioOption: AVMediaSelectionOption) {
        setMediaSelectionOption(audioOption, characteristic: AVMediaCharacteristicAudible)
    }
    
    private func setMediaSelectionOption(option: AVMediaSelectionOption,  characteristic: String) {
        if let group = mediaSelectionGroup(characteristic) {
            player?.currentItem?.selectMediaOption(option, inMediaSelectionGroup: group)
        }
    }
    
    public override func subtitles() -> [AVMediaSelectionOption]? {
        return mediaSelectionGroup(AVMediaCharacteristicLegible)?.options
    }
    
    public override func audioSources() -> [AVMediaSelectionOption]? {
        return mediaSelectionGroup(AVMediaCharacteristicAudible)?.options
    }
    
    private func mediaSelectionGroup(characteristic: String) -> AVMediaSelectionGroup? {
        return player?.currentItem?.asset.mediaSelectionGroupForMediaCharacteristic(characteristic)
    }
    
    deinit {
        removeObservers()
    }
    
    private func removeObservers() {
        if player != nil {
            player?.removeObserver(self, forKeyPath: "currentItem.status")
            player?.removeObserver(self, forKeyPath: "currentItem.loadedTimeRanges")
            player?.removeObserver(self, forKeyPath: "currentItem.playbackLikelyToKeepUp")
            player?.removeObserver(self, forKeyPath: "currentItem.playbackBufferEmpty")
        }
        NSNotificationCenter.defaultCenter().removeObserver(self)
    }
