sachinchoolur / lightGallery

A customizable, modular, responsive, lightbox gallery plugin.
https://www.lightgalleryjs.com/
Other
6.56k stars 1.29k forks source link

Thumbnail not showing up on inline gallery #1482

Closed fodor95 closed 1 year ago

fodor95 commented 1 year ago

Description

Video thumbnail is not fetched when attaching a video to an inline gallery. The video is playing normally. It could be that I am doing something wrong. Many thanks in advance, Tibi

Steps to reproduce

image

JS code that you use to initialize lightGallery.


                dynamicEl: [
                    // html5 video 
                    {
                        video:{
                            source: [
                                {
                                    src: 'http://fp1.local/wp-content/video/1678165117-small.mp4',
                                    thumb: 'http://fp1.local/wp-content/uploads/classified-listing/2023/03/pexels-zinpix-1899567-scaled.jpg',
                                    type: 'video/mp4',
                                },
                            ],
                            attributes: { preload: false, controls: true },
                        }
                    },
                    // * html5 video 

Sample HTML markup

        <div class="d-flex justify-content-center">
            <div id="inline-gallery-container" class="inline-gallery-container"></div>
        </div>

Environment

sachinchoolur commented 1 year ago

Hey @fodor95,

thumb should be outside the video object


                dynamicEl: [
                    // html5 video 
                    {
                        video:{
                            source: [
                                {
                                    src: 'http://fp1.local/wp-content/video/1678165117-small.mp4',
                                    type: 'video/mp4',
                                },
                            ],
                            attributes: { preload: false, controls: true },
                        },
                        thumb: 'http://fp1.local/wp-content/uploads/classified-listing/2023/03/pexels-zinpix-1899567-scaled.jpg',
                    },
                    // * html5 video 

Demo - https://codepen.io/sachinchoolur/pen/VwpYagE

fodor95 commented 1 year ago

Hello @sachinchoolur, Thank you for your help, I just tried it out and It works perfectly.