sachinchoolur / lightGallery

A customizable, modular, responsive, lightbox gallery plugin.

Home Page:https://www.lightgalleryjs.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Inline Video Question

patarstar7 opened this issue Β· comments

Hi πŸ‘‹

Is there a way to add a video as a thumbnail and have it autoplay? Also any approach to potentially control the video inline before going into the lightbox itself?

<LightGallery
  plugins={[lgVideo]}
  videojs={videojs}
  ...
>
  <div id="animated-thumbnails">
    <a href="img/img1.jpg">
      <img src="img/thumb1.jpg" />
    </a>
    <a href="img/img2.jpg">
      // Video here
    </a>
    ...
  </div>
</LightGallery>

Hey @patarstar7,

Do you mean the thumbnails inside the lightGallery? Currently, it is not possible.

But, you have complete control over the thumbnails markup outside the gallery. You should be able to use video as thumbnails in this case.

Regarding the playsinline attribute,
You can pass any video attribute as shown in the below example.

<a
        data-lg-size="1280-720"
        data-video='{"source": [{"src":"/videos/video1.mp4", "type":"video/mp4"}], "attributes": {"preload": false, "playsinline": true, "controls": true}}'
        data-poster="/images/demo/youtube-video-poster.jpg"
        data-sub-html="<h4>'Peck Pocketed' by Kevin Herron | Disney Favorite</h4>"
    >
        <img
            width="300"
            height="100"
            class="img-responsive"
            src="/images/demo/youtube-video-poster.jpg"
        />
    </a>

Demo - https://www.lightgalleryjs.com/demos/video-gallery/#video-autoplay

Let me know if you have any more questions

commented

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.