Videos don't display in a view's lightbox

Created on 13 July 2022, almost 2 years ago
Updated 20 April 2024, 2 months ago

Good morning everyone, the problem is that the slickLightboxMedia function in the file slick-lightbox.load.min.js does not recognize the oembedUrl data and causes the video not to be mounted and that the tag it uses is an img.
Also the ul.blazy--view--multimedia-gallery that contains the li.grid does not contain the data-slick-lightbox-gallery attribute and the js
slick-lightbox.load.js
does not recognize the gallery in the line
var _gallery = '[data-slick-lightbox-gallery]:not(.' + _mounted + '), .slick-lightbox-gallery:not(.' + _mounted + ')';

and does not mount the slickbox

Steps to reproduce

Drupal core 9.2.13
Blazy: 8.x-2.13
Slick: 8.x-2.6
Slick Lightbox: 8.x-1.5

Create a content type with a media field type image and local video
Create a view of that content type
In the view select format blazy grid
Add a field of type blazy multimedia
In the options of the blazy multimedia field, select the option "image to slick lightbox" in media switcher

Proposed resolution

I have modified the code of the file slick-lightbox.load.min.js and slick-lightbox.load.js
I have added a condition in buildOutMedia and I have added the video tag in the new function that is called if it is a video.

regarding the data-slick-lightbox-gallery error I have added a hook to my theme that adds that attribute to ul.blazy--view--multimedia-gallery

I've shared a patch that adds the changes I've made to slick-lightbox.load.min.js.

I hope it will be useful to find a complete way if you see it necessary to solve this problem.

I hope I have explained myself.

Thank you very much and greetings.

🐛 Bug report
Status

Fixed

Version

1.5

Component

Code

Created by

🇪🇸Spain Carlos Romero

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024