fancyapps / ui

A library of JavaScript UI components, includes the best lightbox - Fancybox5
https://fancyapps.com/
Other
722 stars 91 forks source link

Vimeo parameters have no effect #651

Closed petehjfd closed 1 month ago

petehjfd commented 2 months ago

Describe the bug

Hi

I would like to use a custom color for the Vimeo embed player. As per the docs, my code looks like this:

Fancybox.bind("[data-fancybox]", {
    vimeo: {
        color: 'ff0000'
    }
});

but the embed URL in the output still contains the default 00adef color. This is exactly what gets output by Fancybox:

<iframe class="fancybox__iframe" id="fancybox__iframe_1_0" allow="autoplay; fullscreen" scrolling="auto" src="https://player.vimeo.com/video/100902001?byline=1&amp;color=00adef&amp;controls=1&amp;dnt=1&amp;muted=0" data-ready="true"></iframe>

Reproduction

Additional context

No response

petehjfd commented 2 months ago

I should also add, I've also specified a color in the embed settings for the video in Vimeo (not the example video I've used above) but it gets overridden by the color applied by Fancybox.

I think it would make more sense for Fancybox to omit the color attribute entirely if the vimeo.color option is not specified when Facybox in instantiated.

fancyapps commented 2 months ago

Hi, @petehjfd

Sorry about the confusion, the correct syntax is like this:

Fancybox.bind('[data-fancybox]', {
  Html : {
    vimeo: {
      color: 'ff0000'
    }
  }
});
petehjfd commented 2 months ago

Ah perfect, that works, thanks!