fancyapps / ui

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

Is there any option for setting autoplay off for video url ? #602

Closed token-codeclouds closed 10 months ago

token-codeclouds commented 10 months ago

Is your feature request related to a problem? Please describe.

Is there any option for setting autoplay off for video url ? I am using vimeo link with fancybox. when opening the video its automatically starting but I want to off default autoplay and when click on play button it should play.

Describe the solution you'd like

Fancybox.bind("[data-fancybox]", { // if here i can pass any param for video autoplay false });

Describe alternatives you've considered

No response

Additional context

No response

fancyapps commented 10 months ago

Hi,

Actually, you have two options.

  1. Disable using data attribute - data-video-autoplay="false". Example:
<a href="https://www.youtube.com/watch?v=UFHscDioNWQ" data-video-autoplay="false" data-fancybox="video-gallery">
    <img alt="" width="200" src="http://i3.ytimg.com/vi/UFHscDioNWQ/hqdefault.jpg">
</a>
  1. Disable using JS options:
Fancybox.bind('[data-fancybox]', {
  Html : {
    videoAutoplay: false
  }
});