View Categories

How to Open YouTube Videos in a Lightbox Modal

You can use the MetaSlider Lightbox plugin to show YouTube videos inside a lightbox modal window. The MetaSlider Lightbox plugin support these types of video:

You can enhance your YouTube videos with a lightbox. Visitors can view your videos and then open them inside a modal. This can make the video larger and also darken the background so it’s easier to see the video.

There are two approaches to adding a lightbox to your videos: Automatic Mode and Manual Mode. Go to “Lightbox” in your WordPress admin menu to see these options.


Automatic Mode for YouTube Video Lightboxes #

Under the “Automatic Mode” tab, you can select where the lightbox will be enabled automatically. Check the box for “Videos in post content” to apply the lightbox automatically to YouTube embeds.

Settings for the Video Lightbox
  • This video below is a demo of how the lightbox will appear. Click the “Open in lightbox” button in the top-right corner.

Manual Mode for Video Lightboxes #

The second option is to use “Manual Mode”. This allows you to choose which individual videos will open in a lightbox. This feature works with the WordPress block editor. Let’s see how to add a lightbox to videos that are added via a block.

  • Select the video you want to use with MetaSlider Lightbox. This could be a video from your Media Library, a YouTube video, or a Vimeo video.
  • In the right sidebar, click the “Advanced” tab as in the screenshot below.
  • Add ml-lightbox-enabled to any existing text in this box.
MetaSldier Lightbox CSS class