biati-digital / glightbox

Pure Javascript lightbox with mobile support. It can handle images, videos with autoplay, inline content and iframes
MIT License
2.01k stars 226 forks source link

Usercentrics Cookie Consent Banner Not Displayed for YouTube Videos in Glightbox #494

Closed JS-Media-Creation closed 2 months ago

JS-Media-Creation commented 2 months ago

Hello,

I am using Glightbox to embed YouTube videos on my website. Typically, when a user has previously declined the necessary cookies for YouTube, a cookie consent banner from Usercentrics appears, allowing the user to consent and watch the video.

However, I noticed that when embedding YouTube videos within a Glightbox, the Usercentrics cookie consent banner is not displayed. Instead, the video fails to load and a loading spinner appears indefinitely. This issue prevents users from granting the required cookie permissions to watch the video.

I am unsure whether this issue is related to Glightbox or if it stems from the Usercentrics cookie consent tool. It is worth noting that the banner is embedded via Shadow Root, which makes direct manipulation challenging.

Could you please investigate this issue and consider adding support for displaying the Usercentrics cookie consent banner when a YouTube video is embedded in a Glightbox? This would ensure that users are prompted to give the necessary permissions and can view the video without any issues.

Thank you for your attention to this matter.

Steps to Reproduce:

1.  Embed a YouTube video using Glightbox.
2.  Ensure that Usercentrics cookie consent is required for YouTube videos.
3.  Decline the necessary cookies.
4.  Attempt to open the video in the Glightbox.

Expected Behavior: The Usercentrics cookie consent banner should be displayed, allowing users to consent to the necessary cookies and watch the video.

Actual Behavior: The video fails to load, and a loading spinner is displayed indefinitely.

Environment:

•   Glightbox version: 3.2.0
•   Browser: All

Example:

•   https://skillxprobe.de

Thank you for your help!

Best regards, Jonathan