         Loader.shared.register(plugins: plugins)
     }
 
-    fileprivate func forward(_ event: Event, userInfo: EventUserInfo) {
+    private func forward(_ event: Event, userInfo: EventUserInfo) {
         baseObject.trigger(event.rawValue, userInfo: userInfo)
     }
 

        Logger.logDebug("destroying", scope: "Player")
        baseObject.stopListening()
        Logger.logDebug("destroying core", scope: "Player")
        self.core?.destroy()
        Logger.logDebug("destroying viewController", scope: "Player")
        destroyViewController()
        Logger.logDebug("destroyed", scope: "Player")
    }

    fileprivate func destroyViewController() {
        if let viewController = viewController {
            viewController.player = nil
            viewController.willMove(toParent: nil)
            viewController.view.removeFromSuperview()
            viewController.removeFromParent()
        }

        willMove(toParent: nil)
        view.removeFromSuperview()
        removeFromParent()


open class Player: AVPlayerViewController {
    open var playbackEventsToListen: [String] = []
    private var playbackEventsListenIds: [String] = []
    private(set) var core: Core?
    static var hasAlreadyRegisteredPlaybacks = false
    private let baseObject = BaseObject()

    override open func viewDidLoad() {
        core?.parentView = view

        if isMediaControlEnabled {
            core?.parentView = contentOverlayView
            core?.parentController = self
        }

        NotificationCenter.default.addObserver(self, selector: #selector(Player.willEnterForeground), name:
            UIApplication.willEnterForegroundNotification, object: nil)
    }

    open var isMediaControlEnabled: Bool {
        return core?.options[kMediaControl] as? Bool ?? false
    }

    @objc private func willEnterForeground() {
        if let playback = activePlayback as? AVFoundationPlayback, !isMediaControlEnabled {
            Logger.logDebug("forced play after return from background", scope: "Player")
            playback.play()
