3

I'm trying to use this plugin: https://github.com/sachinchoolur/lightGallery

What i can't understand is - does it generate thumbnails for images/video?

And i can't get thumbnails from youtube using the docs...

CSS:

<link rel="stylesheet" href="/static/css/lightgallery.min.css">
<script type="text/javascript" src="/static/js/lg-fullscreen.min.js"></script>
<script type="text/javascript" src="/static/js/lightgallery.min.js"></script>
<script type="text/javascript" src="/static/js/lg-thumbnail.min.js"></script>
<script type="text/javascript" src="/static/js/lg-video.min.js"></script>

JS:

$('.light-gal-item').lightGallery({
    thumbnail: true,
    thumbWidth: 120,
    thumbContHeight: 90,
    loadYoutubeThumbnail: true,
    youtubeThumbSize: 'default'
});

HTML:

<div class="light-gal-item">
    <a href="http://www.youtube.com/watch?v=P5_GlAOCHyE" data-src="http://www.youtube.com/watch?v=P5_GlAOCHyE">
        <img src="http://www.youtube.com/watch?v=P5_GlAOCHyE"
             width="120" height="90" />
    </a>
</div>

It does images like that... but even so, i cant figure out if it does thumbnails, or if it needs them by different url...

And it doesn't make youtube thumbnails... HELP!

old_timer
  • 69,149
  • 8
  • 89
  • 168
Tosh
  • 281
  • 3
  • 15

1 Answers1

1

I have the same problem, but maybe you can use this trick

This is my code

<div id="video-gallery">
<a href="https://www.youtube.com/watch?v=P1mmrxt71RQ">
<img src="http://img.youtube.com/vi/P1mmrxt71RQ/0.jpg" class="cropped" />
</a>
</div>

You just replace the youtube video id on img src, on this example "P1mmrxt71RQ". To search another youtube thumbnail size use this http://boingboing.net/features/getthumbs.html

And for this trick, you dont necessary use

<script type="text/javascript" src="/static/js/lg-thumbnail.min.js"></script>

I hope this help

  • Yeah, I know how to get youtube thumbs from the //img.youtube.com/ url. I thought that lightgallery does that for me. I guess it does not. – Tosh Aug 05 '16 at 10:17