sachinchoolur/lightGallery

DASH playback in videojs is broken

OctoNezd opened this issue · 1 comments

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

  • Browser and version - Firefox 121.0, can also reproduce on Edge 120.0.2210.91
  • OS - Windows 11
  • lightGallery version - 2.7.2

Additional context

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.