  
         self.playbackDelegate = nil
         self.removePlayerLayerObservers()
-        self._playerView.player = nil
+        if let playerVC = self._nativePlayerViewController {
+            playerVC.player = nil
+        } else {
+            self._playerView.player = nil
+        }
     }
 
     // MARK: - view lifecycle
 
-    open override func loadView() {
-        self._playerView.playerIsHidden = false
-        self.view = self._playerView
-    }
-    
     open override func viewDidLoad() {
         super.viewDidLoad()
-        
+
+        if useNativeUI {
+            self._nativePlayerViewController = AVPlayerViewController()
+        }
+
+        if let playerVC = self._nativePlayerViewController {
+            self.view.addSubview(playerVC.view)
+            playerVC.view.translatesAutoresizingMaskIntoConstraints = false
+            self.view.addConstraints(NSLayoutConstraint.constraints(withVisualFormat: "H:|-\(0)-[subview]-\(0)-|", options: [], metrics: nil, views: ["subview": playerVC.view]))
+            self.view.addConstraints(NSLayoutConstraint.constraints(withVisualFormat: "V:|-\(0)-[subview]-\(0)-|", options: [], metrics: nil, views: ["subview": playerVC.view]))
+            self.addChildViewController(playerVC)
+        } else {
+            self._playerView.playerIsHidden = false
+            self.view = self._playerView
+        }
+
         if let url = url {
             setup(url: url)
         } else if let asset = asset {

        }
    }

    var playerViewController: PlayerAVPlayerViewController?

    var playerLayer: AVPlayerLayer {
        get {
            return self.layer as! AVPlayerLayer

    /// Player view's initial background color.
    open var layerBackgroundColor: UIColor? {
        get {
            if let playerVC = self._nativePlayerViewController {
                return playerVC.view.backgroundColor
            }
            return self._playerView.playerBackgroundColor
        }
        set {
            if let playerVC = self._nativePlayerViewController {
                playerVC.view.backgroundColor = newValue
            } else {
                self._playerView.playerBackgroundColor = newValue
            }
        }
    }
    
