The WordPress Video Lightbox plugin allows you to embed videos on a page using lightbox overlay display similar to the one shown below. This plugin can be used to display images, flash, YouTube, Vimeo, iFrame etc in a lightbox overlay. The embedded videos can be viewed on iPad too.
Click on the image below to see how the video pops over in a lightbox overlay.
Little Background
Previously I was using another plugin to display my Vimeo videos in a lightbox overlay but recently Vimeo changed their video embed code to use HTML5 in an effort to make the videos playable in iPhone and iPad. Unfortunately, the other plugin wasn’t working with this change and I was getting the following error on all my embedded Vimeo videos:
Sorry, this video does not exist
To get around the problem I created this plugin and tweaked the required JQuery library so it works with the new Vimeo video embed code. When you use this plugin to embed videos it will play your YouTube or Vimeo videos on iPhone and iPad too!
Download WP Video Lightbox
Download the WP Video Lightbox Plugin from here.
Plugin Compatibility
Works with the latest version of WordPress.
Plugin Requires
Requires WordPress 3.5 or higher.
Plugin Installation
- Unzip and Upload the folder ‘wp-video-lightbox’ to the ‘/wp-content/plugins/’ directory.
- Activate the plugin through the ‘Plugins’ menu in WordPress.
- Follow the instructions in the “Usage” section to start embedding your images, videos etc.
Plugin Usage
Our documentation for this plugin shows the various ways to use this plugin.
- Check the WP Video Lightbox Plugin Documentation.
How to Turn Off the Related Videos At the End of a YouTube Video
If you do not want to show the “suggested videos” that YouTube shows at the end of a video playback then use the following technique:
Add &rel=0 at the end of the video ID which will turn off the related videos display.
Here is an example shortcode that shows you how to use this:
[video_lightbox_youtube video_id="G7z74BvLWUg&rel=0" width="640" height="480" anchor="click me"]
Alternatively, you can use “rel=false” at the end of the video URL to turn off the the related videos. Here is an example:
[video_lightbox_youtube video_id="G7z74BvLWUg&rel=false" width="640" height="480" anchor="click me"]
Automatically Use Video Thumbnail as Anchor
You can use an extra parameter in the shortcode to automatically generate and use the thumbnail of the YouTube or Vimeo video as the anchor image.
Here is an example usage of the shortcode with auto thumbnail option:
[video_lightbox_youtube video_id="G7z74BvLWUg" width="640" height="480" auto_thumb="1"]
Or the following for Vimeo video:
[video_lightbox_vimeo5 video_id=29417470 width=800 height=450 auto_thumb="1"]
The above shortcode will produce the following anchor image for the embedded video (it takes the thumbnail of the video automatically):
Using an Image as the Anchor of a Video
You can use an image as the anchor of the video (that will trigger the lightbox effect). Enter the image URL in the “anchor” parameter of the shortcode.
Here is an example usage of the shortcode:
[video_lightbox_youtube video_id="G7z74BvLWUg" width="640" height="480" anchor="http://www.yourdomain.com/wp-content/uploads/anchor-image.jpg"]
Make sure to enter a valid image URL for the anchor. You should first enter the anchor image URL in the browser’s address bar to verify that the image loads (that way you know if the image URL is valid or not).
Specifying alt Attribute for Thumbnail Image
You can use the “alt” parameter in the shortcode to specify an alternate text for your thumbnail image. Search Engines read this text description to understand what this image is about.
Here is an example usage of the shortcode with the “alt” parameter:
[video_lightbox_youtube video_id="G7z74BvLWUg" width="640" height="480" anchor="http://www.example.com/images/youtube-thumb.jpg" alt="text that describes this image"]
Specifying a Description for the Video
You can use the “description” parameter in the shortcode to specify a description for the video. The description text will show up below the video in the lightbox window.
Here is an example usage of the shortcode with the “description” parameter:
[video_lightbox_youtube video_id="G7z74BvLWUg" width="640" height="480" description="Test description text for the video"]
How to Enable Privacy-enhanced Mode in a YouTube Video
If you want to enable “privacy-enhanced mode” in a YouTube video, add &nocookie=1 at the end of the video ID.
Below is an example shortcode that shows you how to use this:
[video_lightbox_youtube video_id="G7z74BvLWUg&nocookie=1" width="640" height="480" anchor="click me"]
Check out my projects page for more cool WordPress plugins.
@Thomas, We don’t have an option to open lightbox from just a URL at the moment. But you can use HTML instead of a shortcode. Please check our usage instructions guide for details.
Hi !
I really like your WP Video Lightbox. “Out of the box” it is really working fine. I use a picture as an anchor. But below the picture I also need a button linking to the video. But that does not work with my theme ! Is it possible to use the plugin with a real URL as a parameter without using the shortcode? That would be brilliant !
Thanks
Tom
@John, This feature is available in our Lightbox Ultimate plugin.
Hi, Is there a way to open a YouTube playlist in lightbox?
@Tristen, We don’t have this kind of parameter in the shortcode. Please use remove it and enable the autoplay option in the settings.
My video won’t autoplay even though it’s set to true in the shortcode.
[video_lightbox_vimeo5 video_id="260973989?autoplay=1" width="1024" height="576" autoplay="true" anchor="http://vivaldigroup.com/en/wp-content/uploads/sites/2/2018/03/Video-Cover-2.jpg"]
@Joe, You need to add &rel=0 to prevent related videos from showing at the end of a YouTube video.
Is there a way to not have the extra videos show at the end of the youtube video (i.e. the competing videos)?
e.g. the code is usually ?rel=0&showinfo=0 for the videos at the end not to show it doesn’t work with your pop up
@Bernadette, Please copy and paste the full play button image URL into the address bar to make sure that your browser can load it.
The youtube play button image isn’t showing. I can confirm the play.png image is located in this directory plugin
Can you help with this?
Thank you!
@Aniket, Unfortunately the deeplink option doesn’t directly open a video in lightbox.
Hi, Excellent plugin. Does exactly what it promises.
But kindly help I am facing a small issue. The deeplinking enables appending the link to
example.com/videos-new/#prettyPhoto-video-0/0/
. However, when I copy this link and paste it into a new tab / window of the browser, it simply opens the page but doesnt pop up the lightbox with video.Thanks for your reply – custom CSS has worked.
I found the plugin CSS code and after trying a few changes I could resolve it by using adding this code snippet:
margin-left: auto;
margin-right: auto;
I then removed that code from the plugin CSS and added this custom CSS into my theme options:
.wpvl_auto_thumb_box{
position: relative;
width: 200px;
height: 150px;
margin-left: auto;
margin-right: auto;
}
That has resolved the location problem, so thanks for your suggestion about custom CSS and your help.
@Les, Have you tried any custom CSS to align the image? Please provide a link to the page in question so I can take a look.
I’m using WP Video Lightbox v1.8.4.
The plugin works well but I have one problem – the video thumbnails always default to the left of the page.
It doesn’t matter how I try to position them – center or right they ignore the formatting and appear on the left.
I have tried the plugin on three different sites with different themes and the result is always the same.
How can I fix this?
@Jacob, Autoplay doesn’t work on mobile devices. It’s something disabled in the core hardware by the manufacturer. They designed it so the video will only play when the user initiates it (This prevents unnecessary bandwidth loss when the user is on a metered connection).
Hi there, I’m using your “WP Video Lightbox” plugin…. It work great!
I want to make one tweak to it:
– Make auto play video on mobile so we don’t have to tap twice to see video.
So you see when we tap on a video card in this page it show a small thumbnail of video then if we tap on it we see video on mobile. So I would need to jump this thumbnail and get straitght to video player on mobile.
I’m using and NOT shortcode. And I may have a few tweek to do on the desktop version also.
I need your help asap to finish this video thing.
Thank you veru much.
@Danielle, Disabling the “Autoplay Slideshow” option in the prettyPhoto settings should fix this issue.
Hi, When I use your YouTube shortcode the lightbox refreshes every 2-3 seconds. Is there something I might be missing?
Thank you!
@Sukuma, You don’t need to add any extra code to the shortcode. You can easily enable autoplay in the video lightbox settings.
Hi there, I’ve been using your wp video light box plugin and it’s great. I wanted to know is there any extra code to throw in there that will autoplay the video once it opens in the lightbox? Thanks so much and hope to hear back from you soon.
@Steven, Unfortunately that’s not possible at the moment.
Can you get the video to play full screen automatically?
@ninadsamel, That will require you to use the YouTube/Viemo API to embed a video so your script knows exactly when the video finishes. Unfortunately our plugin simply uses their embed code. It has no way of knowing when to close lightbox. It needs to be manually closed by the viewer.
Hello, I just want to know how should i close WP-Video lightbox once video get stop.
please help
@Asaph, Unfortunately it only plays YouTube/Vimeo videos at the moment. However, you will be able to play your Amazon Cloudfront videos with our Lightbox Ultimate plugin.
Hello, Does this plugin work with amazon cloudfront html content?
@Ilema, Unfortunately we don’t have integration with any button plugin. When you use a video lightbox shortcode it creates a text/image link (It depends on what you specify in the anchor parameter). You just click on that link to open lightbox.
Hi there, does anyone know how to use the Video lightbox with Maxbuttons? My button says Watch this, then I want the video to play in the embedded light box. I don’t know coding very well! Do I add the lightbox shortcode in maxbutton or the maxbutton code in lightbox?
@Jeff, Please replace “?rel=0” with “&rel=0” and see how it goes. Please see the “How to Turn Off the Related Videos” section for details.
Hi, I am looking for the html code to not play related videos.
I embeded my video with this code, works perfect but would like the option to get rid of the related videos at the end.. I put in “?rel=0” at the end of my link but its not working.
Thanks
@Elmi, Video Lightbox doesn’t use any API. It simply inserts the YouTube embed code.
Hi, Does WP Video Lightbox supports youtube API? It does not seem to work when I use the inline content opened in wp-video-lightbox to handle youtube function onYouTubeIframeAPIReady()
Thanks in advance.
@Laurence, We only support popup from either a text link/image in both of our plugins. Button is not supported at the moment.
I have checked the HTML code for your watch video button. It’s not actually a button. It’s just a text link that looks like a button. So you should have no issue opening popup from it.
Hello, I’m currently using the standard version of WP Video Lightbox and love the way that it’s working but would like to open up a lightbox with a button. Is there a way to use an HTML link to open a video lightbox or must it always be an embed code with an image. You can see that my first slide on the page below will open a Video Lightbox when clicked but I would like to have the “Watch Video” button open the lightbox. Can i do this with the Ultimate version?
@Will, Are you using our free video lightbox? It’s already compatible with https. If it’s not working that means you have some other incompatible plugin that is overriding the JavaScript library. You can easily check it in your browser console.
We recently upgraded our site to SSL and the lightbox no longer plays youtube videos. If we upgrade to a purchased version of the plug-in, will it work?
@Gary, Currently the plugin only supports text/image link.
Is there any way to specify shortcode for a button in the anchor, or can you only use text and image?
@Nancy, Your theme seems to be also including the prettyPhoto lightbox library. Can you please disable it?
Video Lightbox is compatible with HTTPS. But it cannot control which library will get included when a page renders. Unfortunately in this case your theme one is getting included which is not compatible with HTTPS by default.
Hello, the youtube short code is not working for me. Am I doing something wrong? I tried it both ways with no success.
[video_lightbox_youtube video_id="z0TbPRiYZkF" width="640" height="480" auto_thumb="1"]
[video_lightbox_youtube video_id="z0TbPRiYZkF" width="640" height="480" anchor="https://example.com/wp-content/uploads/2016/03/video-thumb.jpg" alt="business website design"]
videos can been seen on this test page I created.
https://hummingbirdwebdesign.com/video-test/
@Savannah, We don’t have any slider feature in our plugin. What you can do is edit the image link in your slider so it can pop up a vimeo video in lightbox. You don’t really need to make a lot of changes. Just adding a
rel="wp-video-lightbox"
in the link should do the trick. Please check our usage instructions guide for details.Is it possible to use vimeo light boxes in a layer slider? For example, have the thumbnail image of the video as the layer slider image, and if the user clicks the thumbnail, the lightbox of the video will appear
@Jadmo, You just add shortcodes to the page to embed videos.
Hi, how I can embed more than one video?
@Cathy, We don’t display any share option in our video lightbox plugin. You may have another lightbox plugin installed which is applying these settings.
Can I disable the “share” and “like” options on the videos in the paid and/or free versions?
That did the trick thanks!
@Jas, Have you disabled the “autoplay slideshow” checkbox in the settings (Settings->WP Lightbox->Library Settings->prettyPhoto settings)?
Hello,
I have a vimeo video that keeps restarting in lightbox. Any ideas?