     
     @IBAction func toggleRightTime(_ sender: AnyObject) {
         rightTimeIsDuration = !rightTimeIsDuration
-        //updateTime()
+        updateTime()
     }
 }
 
 extension PopOverViewController:  MusicPlayerManagerDelegate {
     func manager(_ manager: MusicPlayerManager, trackingPlayer player: MusicPlayer, didChangeTrack track: MusicTrack, atPosition position: TimeInterval) {
-        print(position)
-        print(track.duration)
-        print("POSITION LKSJFLK JDFLKJ SDFL KJSDLFKJSDLF JSDLKF JSLF JDS")
+        self.duration = track.duration
+        self.position = position
         updateInfo(track: track)
     }
     
     func manager(_ manager: MusicPlayerManager, trackingPlayer player: MusicPlayer, playbackStateChanged playbackState: MusicPlaybackState, atPosition position: TimeInterval) {
+        self.position = position
+        switch playbackState {
+        case .playing, .fastForwarding, .rewinding, .reposition:
+            self.isPlaying = true
+        default:
+            self.isPlaying = false
+        }
         updateInfo(track: player.currentTrack)
         updateButton(state: playbackState)
     }

    private var lastArtworkUrl = ""
    fileprivate var rightTimeIsDuration: Bool = true
    private var defaultImage: NSImage!
    public var musicPlayerManager: MusicPlayerManager!
    
    // MARK: - IBOutlets
    

        self.preferredContentSize = NSSize(width: 300, height: 300)
    }
    
    override func viewWillAppear() {
        super.viewWillAppear()
        self.musicPlayerManager.delegate = self
        
        let track = musicPlayerManager.existMusicPlayer(with: .spotify)?.currentTrack
        updateInfo(track: track)
      
        
        let state = musicPlayerManager.existMusicPlayer(with: .spotify)?.playbackState
        updateButton(state: state)
        
        if let state = state {
            self.isPlaying = state == .playing
        }
        if let track = track {
            self.duration = track.duration
        }
        if let position = musicPlayerManager.existMusicPlayer(with: .spotify)?.playerPosition {
            self.position = position
        }
        
        updateTime()
        
        timer = Timer.scheduledTimer(
            timeInterval: 1,
            target: self,
            selector: #selector(self.updatePlayerPosition),
            userInfo: nil,
            repeats: true)
    }
    
    override func viewDidDisappear() {
        timer.invalidate()
        self.musicPlayerManager.delegate = nil
    }
    
    // MARK: - Public methods
    
    func setUpMusicPlayerManager() {
        if self.musicPlayerManager == nil {
