     if allowIDFA {
       deviceIdentifier = advertisingIdentifier()
     }
+    if parameters.contains(where: { $0.key == DMPlayerViewController.loggerParameterKey }) {
+      loggerEnabled = true
+    }
     self.loadWebView(parameters: parameters, baseUrl: baseUrl, accessToken: accessToken, cookies: cookies)
   }
   

    }
    controller.addUserScript(WKUserScript(source: source, injectionTime: .atDocumentStart, forMainFrameOnly: false))
    controller.add(Trampoline(delegate: self), name: DMPlayerViewController.messageHandlerEvent)
    return controller
  }
  
  private func eventHandler() -> String {
    var source = "window.dmpNativeBridge = {"
    source += "triggerEvent: function(data) {"

    pause()
    webView.stopLoading()
    webView.configuration.userContentController.removeScriptMessageHandler(forName: DMPlayerViewController.messageHandlerEvent)
    if loggerEnabled {
        webView.configuration.userContentController.removeScriptMessageHandler(forName: DMPlayerViewController.consoleHandlerEvent)
    }
  }
  
  /// Load a video with ID and optional OAuth token
