blueimp / Gallery

blueimp Gallery is a touch-enabled, responsive and customizable image & video gallery, carousel and lightbox, optimized for both mobile and desktop web browsers. It features swipe, mouse and keyboard navigation, transition effects, slideshow functionality, fullscreen support and on-demand content loading.
https://blueimp.github.io/Gallery/
Other
3.75k stars 984 forks source link

Display iframe as slide content instead of image #264

Closed ManuelHaas closed 2 years ago

ManuelHaas commented 2 years ago

Hi Sebastian,

thank you for your great libraries (gallery, file-upload, canvas-to-blob etc.)! I would like to extend the gallery to display pdf. I have already developed a working solution using pdf.js. This can be included using iframe. I'm just looking for a way how to display my iframe as slide content (instead of the image) when the pdf is clicked and the gallery is opened. Do you have a tip for me how to implement this?

Many thanks!

blueimp commented 2 years ago

Hi @ManuelHaas, yes, there is a way to display any kind of content via additional content types. You could implement an applicationFactory that checks the obj argument property obj.type for application/pdf and returns an element that will display the PDF (e.g. using PDF.js).

ManuelHaas commented 2 years ago

@blueimp Thank you so much for your explanations. You saved my day!