     private var lastArtworkUrl = ""
     fileprivate var rightTimeIsDuration: Bool = true
     private var defaultImage: NSImage!
-    public var musicPlayerManager: MusicPlayerManager!
+    private var musicPlayerManager: MusicPlayerManager!
+    private var position: Double = 0
+    private var duration: Double = 0
+    private var isPlaying: Bool = false
+    private var timer: Timer!
     
     // MARK: - IBOutlets
     

            self.musicPlayerManager.add(musicPlayer: MusicPlayerName.spotify)
            self.musicPlayerManager.add(musicPlayer: MusicPlayerName.iTunes)
        }
        self.musicPlayerManager.delegate = self
    }
    
    // MARK: - Public methods
    

    func updateInfo(track: MusicTrack?) {
        if let track = track {
            if let artworkUrl = track.artworkUrl , artworkUrl != lastArtworkUrl {
                self.artworkImageView.downloadImage(url: URL(string: artworkUrl)!)
                lastArtworkUrl = artworkUrl
            }
            if track.artworkUrl == nil {
                artworkImageView.image = defaultImage

        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 {
