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

      completion?()
      return
    }
    
    let js = buildLoadString(videoId: videoId, params: params)
    
    webView.evaluateJavaScript(js) { _,_ in

      return nil
    }
  }

  private func setConsentCookie() {
    if let tcString = UserDefaults.standard.string(forKey: DMPlayerViewController.tcStringKey) {
      var cookieProperties: [HTTPCookiePropertyKey: Any] = [
        .name: DMPlayerViewController.tcStringCookieName,
        .value: tcString,
        .domain: "dailymotion.com",
        .path: "/",
        .secure: true
      ]
      if let expiresDate = Calendar.current.date(byAdding: .month, value: 6, to: Date()) {
        cookieProperties[.expires] = expiresDate
      }

      guard let cookie = HTTPCookie(properties: cookieProperties) else { return }

      HTTPCookieStorage.shared.setCookie(cookie)
    }
  }

}

