         removeCurrentTimeObserver()
         
         lastPlayerTimeObserve = player
-        self.timeObserverToken = player?.addPeriodicTimeObserverForInterval(interval, queue: dispatch_get_main_queue()) { [weak self] time-> Void in
+        self.timeObserverToken = player?.addPeriodicTimeObserver(forInterval: interval, queue: DispatchQueue.main) { [weak self] time-> Void in
             if let mySelf = self {
-                self?.delegate?.playerVideo(mySelf, currentTime: mySelf.currentTime)
-            }
-        }
+                self?.delegate?.playerVideo(player: mySelf, currentTime: mySelf.currentTime)
+            }
+            } as AnyObject?
     }
     
     func playerItemDidPlayToEndTime(aNotification: NSNotification) {

        imageGenerator.requestedTimeToleranceAfter = CMTime.zero
        imageGenerator.requestedTimeToleranceBefore = CMTime.zero
        
        let ref = try imageGenerator.copyCGImageAtTime(cmTime, actualTime: &timePicture)
        let viewImage: UIImage = UIImage(CGImage: ref)
        return (viewImage, timePicture)
    }
    public var url: NSURL? {
        didSet {
            guard let url = url else {
                urls = nil

        }
        player.pause()
        
        removeObserversPlayer(avPlayer: player)
        
        if let playerItem = player.currentItem {
            removeObserversVideoItem(playerItem: playerItem)
        }
        self.player = nil
    }
