sachinchoolur / lightGallery

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

DASH playback in videojs is broken #1578

Closed OctoNezd closed 10 months ago

OctoNezd commented 10 months ago

Description

It's impossible to set DASH source in videojs when using lightgallery.

Steps to reproduce

Demo: https://codepen.io/octonezd/pen/LYaGOao

  1. Create anchor with data pointing to DASH source

JS code that you use to initialize lightGallery.

function opengallery() {
  const lg = lightGallery(document.getElementById("gallery"), {
    plugins: [lgVideo],
    speed: 250,
    mobileSettings: {},
    videojs: true,
    videojsOptions: {
      vhs: {
        overrideNative: true
      },
      html5: {
        vhs: {
          overrideNative: true
        },
        nativeAudioTracks: false,
        nativeVideoTracks: false
      }
    }
  });
  lg.openGallery()
}

Sample HTML markup

<div id="gallery">
    <a data-video="{&quot;source&quot;:[&quot;https://v.redd.it/be101931ndac1/DASHPlaylist.mpd&quot;],&quot;attributes&quot;:{&quot;preload&quot;:false,&quot;playsinline&quot;:true,&quot;controls&quot;:true}}" data-lg-size="1280-720" data-sub-html="">
      <img referrerpolicy="no-referrer" src="https://external-preview.redd.it/YmFwb3JwejBuZGFjMYaOaN5dQT3MQ130NxDcBZQpVq3Z1AHPX2eSYT88-A8S.png?width=140&amp;height=130&amp;crop=140:130,smart&amp;format=jpg&amp;v=enabled&amp;lthumb=true&amp;s=d1b2de1b7b136eca44e3914b4128ad4d87b34843"></a>
  </div>

Environment

Additional context

OctoNezd commented 10 months ago

Can't reproduce anymore in codepen for some reason. I assume its an issue with the way extension injects its features.

Sorry for creating this issue.