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

In version 2.5.0-beta.2 it is no longer necessary to include videojs as an attribute ?

darmon77 opened this issue · comments

Description

I'm testing version 2.5.0-beta.2 and I'm having some problems with html5 videos.
When I use the videojs: true attribute, the console suggests that I include videojs
"lightGallery:- Make sure you have included videojs"
add videojs to your javascript and css file ( videojs V7.19.0 cdnjs.com), and remove the videojs: true attribute from my configuration file, with that configuration I don't send console errors and it works as expected.

Is this no longer necessary?

 plugins: [lgVideo, lgFullscreen, lgHash, lgZoom, lgAutoplay, lgRotate, lgThumbnail],
        videojs: true,
        videojsOptions:{
         muted: false,
          loop: true, 
          autoplay: true,
        },

My code to get started, testing all set and unset functionality

 jQuery("#test")
  .justifiedGallery({
    captions: true,
    lastRow: "center",
    rowHeight: 160,
    border: 4,
    maxRowHeight:	120,
    randomize: true,
    filter: false,
    cssAnimation: false,
    waitThumbnailsLoad:	false,
    margins: 5
    
  })
  .on("jg.complete", function () {
    window.lightGallery(
      document.getElementById("test"),
      
      {
        autoplayFirstVideo: true,
        youtubePlayerParams:{modestbranding: 1, showinfo: 1, controls: 0, disablekb: 1, fs:1},
        thumbnail: true,
        thumbWidth: 120,
        thumbContHeight: 90,
        loadYoutubeThumbnail: true,
        youtubeThumbSize: true,
        pager: false,
        download: false,
        vimeoPlayerParams:{color: 'c80a48',
        showVimeoThumbnails: true,
        showThumbnailWithPlayButton: true,
        backgound:'c80a48',
        muted: true, 
        transparent: true,
        pip: true,
        playsinline: true,
        controls:true,
        dnt: true,
        showVimeoThumbnails: true,
      },
        galleryId: "XD",
       
        plugins: [lgVideo, lgFullscreen, lgHash, lgZoom, lgAutoplay, lgRotate, lgThumbnail],
        videojs: true,
        videojsOptions:{
         muted: false,
          loop: true, 
          autoplay: true,
          
        },
        toggleThumb: true,
        ismobile: true,
        hash: true,
        customSlideName : true,
        mobileSettings: {
        controls: false,
        toggleThumb: true,
        background: "fff",
          showCloseIcon: true,
          download: false,
          rotate: false,
          muted: true,
          pager: false
          
        }
      }
    );
  });

Sample HTML markup

<div id="lightgallery">
    <a href="img/img1.jpg" data-lg-size="1600-2400">
        <img alt=".." src="img/thumb1.jpg" />
    </a>
    <a href="img/img2.jpg" data-lg-size="1024-800">
        <img alt=".." src="img/thumb2.jpg" />
    </a>
    ...
</div>

Environment

  • Browser and version - Google Chorme,99.0, Mozilla Firefox 98.0
  • Linux, Windows, MacOs -
  • lightGallery version - 2.5.0-beta.2

Additional context

Hey @darmon77,

Sorry for the delayed response. I missed your message.
Yes, you need to pass videojs : true via settings to enable videojs.

You won't see the console warning to include videoJS when videojs is not enabled

Let me know if you have any more questions