View Categories

How to Open Local Videos in a Lightbox Modal

You can use the MetaSlider Lightbox plugin to show videos inside a lightbox modal window. The MetaSlider Lightbox plugin supports videos hosted inside your WordPress media library. You can use MetaSlider Lightbox to showcase your .MP4, .WebM, and .MOV videos.

You can enhance your locally hosted 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 Local 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 your videos.

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 Local 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 locally hosted video you want to use with MetaSlider Lightbox.
  • In the right sidebar, click the “Advanced” tab as in the screenshot below.
  • Add ml-lightbox-enabled to any existing text in this box.
Additional CSS classes