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.
Great plugin, is there a way that when the page loads it triggers the light box and starts playing the video automatically?
Love the plugin!
Can’t get autoplay to work for vimeo though.
Also, is there a way to add a hover over effect to thumbnail images (ie: display a different image with just text)
Thanks in advance!
Started using this after another modal plugin broke when I upgraded WordPress.
Excellent plugin for videos.
Using this and Compact Audio player for my husband’s site. Thanks for the tips and tricks too! It’s perfect!
@CbrisB, The mod Leslye submitted is to automatically create and generate a thumbnail image from the video and use that as an anchor.
From the comments I have read here the autostart is not supported by the free version. Is it supported if the user ” WP Video Lightbox Thumbnail Mod Submitted by Leslye” php file is loaded?
If not, what is the above mod for?
I got it to work – thanks its a great plugin!!
I worked out how to disable related videos from showing up! 🙂 Instead of using rel=0 I tried rel=false AND IT WORKED!!
http://www.youtube.com/watch?v=VIDEO-ID-IN-HERE&rel=false
I LOVE THIS PLUG IN – it’s the best plugin I’ve ever found I reckon…. well done 🙂
Awesome plug-in! makes it all so simple.
The plugin really worked for me. It has made my work easy. Thanks for the share and keep up the noble work!!!
Nice plugin that actually works. I tried another version wp lightbox plus colorbox plugin that I couldn’t get to work. Thanks admin for your reply “You simply use the image URL as the value of the “anchor†parameter. Here is an example shortcode usage with an image as the anchor:
[video_lightbox_youtube video_id="G7z74BvLWUg" width=640 height=480 anchor="https://www.tipsandtricks-hq.com/wp-content/uploads/2010/08/video-lightbox-thumb2.png"]
That the code I needed to use image. and I put the rel=0 after id to show no related videos. Thanks for all your help.
Very nice and handy…hats off to u
Really great plugin, thank you! Very clean, works as advertised and really straightforward to use it.
This is a great and easy to use plugin – handled my needs right away!
@Lin, I have made a small update to the plugin which will allow this.
Please download the new version of the plugin (v1.4) from this page then check the section with the following heading (it tells you how you can turn ff the related videos from showing at the end of the video)
How to Turn Off the Related Videos At the End of a YouTube Video
Hope someone can help. I really like the WordPress Video Lightbox plugin, but have been searching to find out how I can turn-off ‘related videos’ from showing up at the end of the video. I can turn them off at YouTube, but not with this plug-in.
This was the answer to my prayers. EXACTLY what I needed! Stumble onto it, glad I found this plugin. Thanks a bunch!
If it helps anyone else, I found the following to be the definitive url formats to use:
http://youtube.com/watch?v=abcd1234
http://vimeo.com/abcd1234
Just change the abcd1234 on the above obviously. I went round in circles for a long time trying plugins and URL formats, but this plugin, with the above formats definitely works.
Great plugin – exactly what I needed and a piece of cake to instal!
Just wanted to thank you for creating a perfect solution to my clients’ request along with excellent info on using the plug-in. It works perfectly linking to images as buttons with almost no effort whatsoever.
Just a quick FYI for anyone trying to link a YouTube vid to am image as a button:
<a href="http://www.youtube.com/watch?v=G7z74BvLWUg" title="" rel="nofollow">
In that bit of the code, remove the space that you’ll find in the pdf instructions file here:
youtube.com/watch?v=G7z74BvLWUg" rel="wp-video-lightbox"
To:
youtube.com/watch?v=G7z74BvLWUg" rel="wp-video-lightbox"
This space between the video URL and the rel= code kept this from working ’till I deleted it.
Great documentation, otherwise! You rock.
This might help somebody in the future, I had problems getting Vimeo videos to work, YouTube worked fine though.
It turned out the URL I got from Vimeo was wrong, or at least it needed to be changed to work.
The bad URL was:
http://player.vimeo.com/video/48556589
The correct URL is:
http://player.vimeo.com/48556589
So just remove the /video part and that solves the problem. I’m sure the documentation tells you that somewhere but I missed it 🙂
@Larry, You simply use the image URL as the value of the “anchor” parameter. Here is an example shortcode usage with an image as the anchor:
[video_lightbox_youtube video_id="G7z74BvLWUg" width=640 height=480 anchor="https://www.tipsandtricks-hq.com/wp-content/uploads/2010/08/video-lightbox-thumb2.png"]
Not sure if my message from yesterday was deleted but this plugin is AWESOME and very much appreciated
Can you help explain how to replace the anchor YY with an image? I have tried what I know to do (limited) and failing at it (user error)
Thanks!
Oh well, just use followed instructions!
Go to plugin editor, and put the value of autoplay= ‘true’
Great Plugin! Works like a charm! Is there any chance to get this plugin to autorun the videos in lightbox?
Sa-weet little plugin.
Thanks so much!
Already using this plugin and working perfectly.
Thanks
Just wanted to thank you for a super plugin!
If you want autoplay, go to plugin editor, and put the value of autoplay= ‘true’.
Thanks for the plugin btw.
Thank you so much for this. Very useful and well done!
Thank you for the lightbox plugin. I will use this plugin for a few of my current projects!
Yes, please append the example HTML code that have the &;amp between the width and height as this broke the code. Just changed it to width=”640″ height=”420″ and it worked perfectly. Great plugin. Thanks.
You are awesome!! This plugin is awesome!! Awesome!!
Thank you! For taking the time and creating this plug in! And the guide. Much appreciated.
Yes, it will be able to do autoplay for YouTube videos.
Thank you for your quick response. Just to be clear, will Lightbox Ultimate provide autoplay functionality for YouTube videos?
Best, Don
Hi Don, This lightweight plugin does not have autoplay option. The lightbox ultimate one has autoplay option for select libraries.
Hi,
I’m using your great “wp video lightbox” plugin…and launching it after a visitor clicks an image (as shown in your associated PDF).
Doing it this way, is there a way to make the video autoplay when the video player displays in the lightbox? Appending “&autoplay=1” does *not* seem to work. However, “&rel=0” does work to turn-off related videos from showing up.
Best, Don
Dude!
5 plugins, 3 custom script downloads and 6 hours later… and of ALL of the options, yours was the ONLY one that works effortlessly. Intelligently (thank you SHort Code Guy!) and performs without a hiccup.
Next Starbucks is on me, my friend.
Thanks a ton.
ME
Few exactly what I was looking for, you saved my day !
Great Plugin, and it works nicely.
And as a way to say thank you, I posted a quick youtube video, showing and explaining this plugin and how to use it.
http://getyourblogready.com/2011/how-to-display-videos-in-a-fancy-lightbox-overlay-on-wordpress/
Very nice plugin to add Youtube video on blog, I have used it on my blog.
@John, the ability to group images or videos (the concept of image sets) is not present in this lightbox plugin. The premium version has shortcode that can handle this.
The option that is usually in JQuery lightboxes to chain images together (with previous and next buttons) with [name_goes_here] is causing the lightbox to pause on opening (basically breaking it). It that functionality not available with this plugin.
Thank you for the plugin.
@Ricky, This free version of the lightbox video plugin cannot handle .mp4 media files unfortunately.
The wp lightbox ultimate plugin can handle .mp4 media files:
https://www.tipsandtricks-hq.com/wordpress-lightbox-ultimate-plugin-display-media-in-a-fancy-lightbox-overlay-3163
Please can you tell me what the shortcode would be if i wanted to use my own hosted video in .mp4 format. I didnt see anything in the pdf guide that made reference to this format.
Kind regards
Ricky
You mean from the theme’s template file?
You can embed videos from your theme’s template file by putting the shortcode through the do_shortcode() function. For exmaple:
<?php
do_shortcode('[video_lightbox_youtube video_id=XX width=640 height=480 anchor=YY]');
?>
Is there any way to embed the plugin on the theme of wordpress?
hey thanks. awesome plugin 😀 this saved my lots of time
Thanks for the awesome plugin – didnt have to search long to find it!
and very easy to install – thanks!