     @available (iOS 9.0, *)
     private func setupPictureInPictureController(playerLayer: AVPlayerLayer) {
 
-        if AVPictureInPictureController.isPictureInPictureSupported() && self.allowsPictureInPicturePlayback {
-
-            self.pictureInPictureController = AVPictureInPictureController(playerLayer: playerLayer)
-        }
-        else {
-
-
-        }
+        guard AVPictureInPictureController.isPictureInPictureSupported()
+            && self.allowsPictureInPicturePlayback else {
+
+                return
+        }
+
+        self.pictureInPictureController = AVPictureInPictureController(playerLayer: playerLayer)
     }
 
     // MARK: KVO


    open func load(url: URL, from seconds: Double = 0) {

        self.clear()
        self.setupAsset(url: url, from: seconds)
    }



        DispatchQueue.main.async {

            if let player = self.player {

                player.replaceCurrentItem(with: playerItem)
            }
            else {

                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)
                }
            }
        }
    }
