Lightbox Gallery and Audio Files

Hello,

I am working on upgrading our Omeka S from 3.1.2 to 4.1.1 and am looking through some of the changes. The addition of the configure research page within themes is very cool and makes it much easier to customise how items are displayed.
The addition of the lightbox gallery is also incredibly helpful and makes presenting media much more aesthetically pleasing.

I am currently working in the foundation theme 1. 4.1. My question is around how to deal with audio files. They don’t seem to be rendered in lightbox, so then it feels that I would need to use media embed so that the user could play them on the page (otherwise it is just a link to the media). However, there are instances where there might be both an image and an audio file - which would be great to present in lightbox. Otherwise if i keep both lightbox and media embed, I will get all the media twice.

Is there a way to configure lightbox to also showcase audio files? Is there a way to add it to the whitelist? I know the past instance of lighbox within the foundation theme (Omeka v3) you could manually code/edit the whitelist of media items so that it could include audio (I believe this is how we got around it previously).

Thank you,
Sanjin

Hi @sanjinmuftic ,

It doesn’t look like there is a setting to just include audio files within the lightbox. However, if you want to do some customization, you could potentially do it.

There is a View Helper named SortMedia that you could override. This would allow you to customize the whitelist. I think you’re also going to have to override the LightGalleryOutput Helper to render the audio player as well.

Alternatively, you could also just override the lightbox-gallery-item.phtml partial in the foundation theme directory and just manipulate $lightMedia and $otherMedia to include audio in the gallery output.

@sanjinmuftic I decided to test this to make sure the audio itself would actually play in the lightbox gallery.

In the LightGalleryOutput Helper, the only change I made was to Line 37:

if (null !== $mediaType && (strpos($mediaType, 'video') !== false || strpos($mediaType, 'audio') !== false)) {

Which gives you something like this with the audio player:

I thought you might like to see it because, to me, this doesn’t look very aesthetically pleasing. Just knowing it’s possible, you might be able to do some more customization or decide it’s not worth it.

Yeah, support by the gallery library we use isn’t great for audio, it basically treats it the same way it does video.

We do have the gallery include audio files with the very similar Classic feature so we might adjust S’s to do the same… but we’d have to look at it a little closer.

Thanks so much @fackrellj will give this a try!