• Hi Arno,
    thank you for your great plugin.
    I have a question:
    I’d like to display a YT-video inside the lightbox, would that be possible?
    Before LBWPS I had fancybox and prettyphoto in use, where I could add a data-attribute=”xyz” or a class=”xyz” to a link a href to call the lightbox with other content than an image.
    Thank you for your help on this!
    Viele Grü?e aus Hamburg, Stefan

    • This topic was modified 4 years, 2 months ago by fnkjd77.
Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Arno Welzel

    (@awelzel)

    Technically PhotoSwipe also supports embedding HTML code and not only images, as documented in https://photoswipe.com/documentation/custom-html-in-slides.html.

    However – the frontend script of Lightbox with PhotoSwipe does not know anything about embedded YouTube videos so far. It will just use links to images and add the linked images to the lightbox. This would require to extend the frontend script to fetch video elements as well and to create the required HTML code for the embedded video.

    Another problem: how to open a lightbox for a video? If a user clicks anywhere inside the video frame, the click will be sent to YouTube and not to a local event handler. So you need something else outside the video frame to open it within the lightbox.

    So I’m not sure if this will come soon, but I’ll have look.

    Thread Starter fnkjd77

    (@fnkjd77)

    Thanx for your reply, Arno!
    I understand better now.
    So, for images this LBWPS works really fine.
    I’m afraid I’ll have to choose another lightbox because videos will be a regular case…
    Have a nice one, Stefan

    Plugin Author Arno Welzel

    (@awelzel)

    Good luck!

    However, as I am curious: how should a video practically be opened in a lightbox? Using a separate link next to the video?

    Thread Starter fnkjd77

    (@fnkjd77)

    Hi,
    I was planning to insert a thumbnail for the video and add a link to that image.
    The YT-video would then be shown in a lightbox.
    I have built a custom Visual Composer element to handle this and it worked with other lightboxes. But as I like PhotoSwipe really much, it wanted to give it a try…
    Bests, Stefan

    Plugin Author Arno Welzel

    (@awelzel)

    Do you have a working example with another lightbox or the generated HTML code in the frontend as example? Is the link a link to the YouTube video itself? In this case I’d use oembed to fetch the HTML code from YouTube and use the result for the lightbox. This should be manageable for one of the next updates.

    • This reply was modified 4 years, 2 months ago by Arno Welzel.
    • This reply was modified 4 years, 2 months ago by Arno Welzel.
    Thread Starter fnkjd77

    (@fnkjd77)

    Hi,
    you can see a good example in the PrettyPhoto-Docs:
    https://www.no-margin-for-errors.com/projects/prettyphoto-jquery-lightbox-clone/#prettyPhoto
    >> See Youtube Content

    Link structure:
    YouTube
    Bests, Stefan

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Is it possible to display videos/youtube in the lightbox?’ is closed to new replies.