 
     private func setupPlayer(playerItem: AVPlayerItem) {
 
-        self.player = AVPlayer()
-
-        self.addObservers(to: self.player!)
-
-        self.player!.replaceCurrentItem(with: playerItem)
-
-        self.playerView.player = player
-
-        if #available(iOS 9.0, *) {
-
-            self.setupPictureInPictureController(playerLayer: self.playerView.playerLayer)
+        DispatchQueue.main.async {
+
+            self.player = AVPlayer(playerItem: playerItem)
+
+            self.addObservers(to: self.player!)
+
+            self.playerView.player = self.player
+
+            if #available(iOS 9.0, *) {
+
+                self.setupPictureInPictureController(playerLayer: self.playerView.playerLayer)
+            }
         }
     }
 


            if self.playerStatus != oldValue {


                self.delegate?.playerViewController(self, didChangePlayerStatus: self.playerStatus)
            }
        }
    }


    open func clear() {

        DispatchQueue.global().async {

            self.asset?.cancelLoading()
            self.asset = nil

            if let playerItem = self.playerItem {

                playerItem.cancelPendingSeeks()

                self.removeObservers(from: playerItem)
            }

            self.playerItem = nil

            if let player = self.player {

                player.cancelPendingPrerolls()

                self.removeObservers(from: player)
            }

            self.playerView.player = nil
            self.player = nil

            if #available(iOS 9.0, *) {

                self.pictureInPictureController = nil
            }

            self.playerStatus = .unknown
            self.playbackStatus = .unstarted
        }
    }

    open func load(url: URL) {
