 
         player.on(Event.requestFullscreen) { _ in
             Logger.logInfo("Entrar em modo fullscreen")
-            if self.fullscreenByApp {
-                self.player.setFullscreen(true)
-            }
+            self.onRequestFullscreen()
         }
 
         player.on(Event.exitFullscreen) { _ in
             Logger.logInfo("Sair do modo fullscreen")
-            if self.fullscreenByApp {
-                self.player.setFullscreen(false)
-            }
+            self.onExitFullscreen()
         }
+    }
+
+    func onRequestFullscreen() {
+        guard fullscreenByApp else { return }
+        fullscreenController.modalPresentationStyle = .overFullScreen
+        present(fullscreenController, animated: false) {
+            self.player.setFullscreen(true)
+        }
+        fullscreenController.view.addSubviewMatchingConstraints(player.core!)
+    }
+
+    func onExitFullscreen() {
+        guard let core = player.core, fullscreenByApp else { return }
+        fullscreenController.dismiss(animated: false) {
+            self.player.setFullscreen(false)
+        }
+        core.parentView?.addSubviewMatchingConstraints(core)
     }
 
     override func viewWillDisappear(_ animated: Bool) {


class ViewController: UIViewController {

    @IBOutlet weak var playerContainer: UIView!
    var player: Player!
    var options: Options = [:]

    var fullscreenByApp: Bool {
        return options[kFullscreenByApp] as? Bool ?? false
    }

    var deviceIsOnLandscape: Bool {
        return [UIDeviceOrientation.landscapeLeft, UIDeviceOrientation.landscapeRight].contains(UIDevice.current.orientation)
    }

    override func viewDidLoad() {

        listenToPlayerEvents()

        player.attachTo(playerContainer, controller: self)
    }

    func listenToPlayerEvents() {
