                     }
 
                     it("should post notification `didExitFullscreen`") {
-                        let fullscreenHandler = core.fullscreenHandler
                         self.expectation(forNotification: InternalEvent.didExitFullscreen.rawValue, object: fullscreenHandler) { notification in
                             return true
                         }
                         fullscreenHandler.exitFullscreen([:])
                         self.waitForExpectations(timeout: 2, handler: nil)
                     }
+
+                    it("should set layout to embed") {
+                        core.parentView = UIView()
+                        fullscreenHandler.exitFullscreen([:])
+                        let controller = core.fullscreenController
+                        expect(core.parentView?.subviews.contains(core)).to(beTrue())
+                    }
                 }
             }
         }

                    }

                    it("should post notification `didEnterFullscreen`") {
                        let fullscreenHandler = core.fullscreenHandler
                        self.expectation(forNotification: InternalEvent.didEnterFullscreen.rawValue, object: fullscreenHandler) { notification in
                            return true
                        }
                        fullscreenHandler.enterInFullscreen([:])
                        self.waitForExpectations(timeout: 2, handler: nil)
                    }
                }

                context("and player close fullscreen mode") {

                    it("should set property `fullscreen` of mediaControll to `false`") {
                        core.mediaControl?.fullscreen = false
                        core.fullscreenHandler.exitFullscreen([:])
                        expect(core.mediaControl?.fullscreen).to(beFalse())
                    }

                    it("should post notification `willExitFullscreen`") {
                        let fullscreenHandler = core.fullscreenHandler
                        self.expectation(forNotification: InternalEvent.willExitFullscreen.rawValue, object: fullscreenHandler) { notification in
                            return true
                        }

            context("when fullscreen is done by app") {

                var core: Core!
                var fullscreenHandler: FullscreenStateHandler!

                beforeEach {
                    core = Core(options: [kFullscreenByApp: true] as Options)
                    fullscreenHandler = core.fullscreenHandler
                }

                context("and player enter in fullscreen mode") {

                    beforeEach {
                        fullscreenHandler.exitFullscreen([:])
                    }

                    it("should set property `fullscreen` of mediaControll to `true`") {
                        fullscreenHandler.enterInFullscreen([:])
                        expect(core.mediaControl?.fullscreen).to(beTrue())
                    }

                    it("should post notification `requestFullscreen`") {
                        self.expectation(forNotification: Event.requestFullscreen.rawValue, object: fullscreenHandler) { notification in
                            return true
                        }
