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

Unlisted Vimeo videos no longer working do to privacy updates #440

Open skyeklein opened 1 year ago

skyeklein commented 1 year ago

Describe the bug Vimeo have updated their embed functionality to require a "privacy hash" querystring parameter for unlisted videos. More information here

Unlisted Vimeo videos loaded into GLightbox now result in a "Sorry this video does not exist" message as the required querystring is not being added to the iframe src URL.

Are you able to reproduce the bug in the demo site No

To Reproduce Steps to reproduce the behavior:

  1. Go to https://www.cabrini.com.au/doctor-portal/resources/
  2. Click on "2023 dates and presentations"
  3. Click on "Workplace decisions: how do we decide what’s best and why?"
  4. See "Sorry this video does not exist" message
  5. Using inspector, dig down to the current GLightbox iframe
  6. Append the &h=d30c95d242 security hash to the iframe src so it now reads https://player.vimeo.com/video/846486260?loop=false&autoplay=false&muted=false&gesture=media&playsinline=false&byline=false&portrait=false&title=false&speed=true&transparent=false&customControls=true&h=d30c95d242
  7. Hit enter - video should now display correctly

Expected behavior Iframe rendering code should extract the ?h=xxxx param from the Vimeo link href and append it to the iframe src along with the rest of the params

Post the code you are using

const videoModal = () => {
  GLightbox({
    selector: 'a[href*="vimeo.com"]',
    touchNavigation: true,
    autoplayVideos: true
  });
}

Screenshots image

Desktop:

mpmrepository commented 1 year ago

Has anyone found a way around this? I'm struggling

skyekleinversa commented 1 year ago

Has anyone found a way around this? I'm struggling

I haven't had time dig any deeper In the meantime, changing the privacy setting for affected videos from "private" to "hide from Vimeo" fixes the issue. It's not a perfect solution, but did the job in our case, for now.