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! I modified it to automatically pull thumbnails from Vimeo and YouTube when anchor=thumb. I can send you the code if you’d like…
@Yong, you set that up in your video hosting site’s preferences. This plugin just shows whatever the video shows.
Thank you for this great plugin. This is what I exactly was looking for.
I have a question. Is there any way to turn off showing related videos at the end of playing video?
Thank you,
Oh, Graham, to change it to autoplay just go into the plugin’s folder, and edit line 109 of wp-video-lightbox.php, you’ll find there $vid_lightbox_autoplay = ‘false’;
— just change it to TRUE.
Thanks, man! It works like a charm with the latest version of WP (3.0.4)
Hi,
Thank you for the awesome plugin. the non-html code works, not just on pages and posts, but in text/html widgets too. Awesome!
Is there a way to make the video play automatically?
Thanks in advance,
Graham
Thank you for this plugin, works well and it’s very clean!
Perfect for youtube videos
Very good post, i enjoyed it alot.
DId you specify the height and width in the shortcode? Please post a link to your web page where you have placed this video.
First of all awesome plugin! It’s working fine but I noticed that the lightbox behind my videos is smaller than the size of my video. It looks kinda weird. The demo video on this page shows your video fitting perfectly inside the black box. Any ideas?
Thanks!
update:
im new to wp so not exactly sure what i am doing…..
i had put some javascript links in the header but by removing them the script work.
when i put the javascript links in the footer video lightbox still worked…
so i guess javascript links should go in the footer!
brilliant script
thanks
update: it was my template header.php. I used part of the header in another temp and it is working great. Thanks again for the great work.
Update: I have used your example code above on a demo page.
http://brian-mccann.com/2010/12/demo/
Can you view my source and see if I am missing any coding?
thanks for help
The plugin looks great. I am having some problems getting it to work. I have add it to my directory, activated it in plugins, and have tried the short code and the html. When I click on the text is simple directs me to the youtubes website to watch the video instead of opening up the lightbox. Any idea what I am doing wrong?
Image should work as an anchor… I am using the following shortcode to display the video on this page which uses and image as anchor:
[video_lightbox_youtube video_id=G7z74BvLWUg width=640 height=480 anchor=https://www.tipsandtricks-hq.com/wp-content/uploads/2010/08/wp-video-lightbox-demo.png]
I have a feeling the image URL you are specifying is resulting a 404? Make sure your image URL is valid.
REPOST for clarity.
(I’m using your SHORT CODE method for youtube)
For me, this only works using ANCHOR TEXT but I sure need to use an IMAGES for the anchor.
The short PDF instructions state “You can use an image as your anchor too†… but I see no example of that. Should I opt for the longer HTML method? …image url’s aren’t working. Is there another way to insert an image for the anchor?
I want this so bad but I use pop up domination and I recently had some problems with J query and popup dom.
Sucks for me. Im so tempted to test it tho
Did you use the shortcode or the HTML approach?
Hello, everyone.
This plugin truly is a life-saver. I was going nuts trying to get HTML5 working with a lightbox effect.
HOWEVER…now my client wants vimeo, and HTML5. For some reason I can get the HTML5 player working with youtube but not my vimeo movies. And I have definitely checked the box (in my vimeo pro account) to make mobile versions of all my vids.
Is anyone else having this problem? Or can see something I’m not? Here’s the link: http://www.christiemcmahoncreative.com/tv, and the video in question is on the second page of the slider, called “Breakfast with Frasier”.
Thanks in advance!
Matt
Thank you so much! ^^
Ahh nevermind. I got it working. Just a note that there’s a typo in your instructions pdf “Plugin Usage Guide”…or maybe it’s just displaying wrong in the mac imageviewer. In the embed flash section example code there’s both an “&” and a “amp;” together. When I removed the “amp;” from the code it worked perfectly. Thanks soo much!
Hey this is amazing! I’ve been looking for a way to have the lightbox effect for both images and video at the same time. Thanks!
One question – I want to use it to post .mov videos but the box doesn’t resize to the video – it just stays at 500x359px. I tried adding &?width=792&height=294 to the end of the .mov filename but no such luck. Any suggestions? Thanks!
I’ve used you awesome products since 2009 and love your customer service, fast response and awesome plugins
Promomblogger – RheaBrown.com
w00t! I’ve been looking everywhere for something like this – this is brilliant!
Thanks a Lot Buddy ! Your website is worth bookmarking ! Awesome Post !
@Cameron, it won’t work on a page if it doesn’t filter the shortcodes that wordpress does by default on it’s posts and pages.
@James, yes but you will need to tweak some code. At the moment eStore uses a different lightbox plugin so it has the rel=”lightbox” attached on the product images. You will just have to change the code os it uses the following and that should do the trick:
rel=”wp-video-lightbox”
@Mike, I personally haven’t tested it but I am pretty sure you will be able to use the .flv file format.
So I broke down and purchased eStore..then I saw this awesome plugin.
I am wondering if I can implement the lightbox into the eStore? I want when you click on a product image to open the larger image it to use the lightbox.
Will your plugin display .mp4 or .flv files from my own web server using the HTML format for Flash? The .swf Flash format does not allow for the length of my videos. So, I use mp4 or flv.
Thanks so much,
Mike
@Cameron, it won’t work on a page if it doesn’t filter the shortcodes that wordpress does by default on it’s posts and pages.
Seriously. Amazing. Had been looking all over for precisely this!
Any way to get this plugin to work on a wp-ecommerce product listing?
It works on regular wordpress pages but not in individual product html.
Use the following code to display your video in an overlay:
<a href="http://www.youtube.com/watch?v=rkRfEJP5pD8" rel="wp-video-lightbox">Click Here</a>
Obviously change “Click Here” with what ever you want to say or use an Image instead.
I attempting to use the HTML method to display video by clicking on the “see what people are saying about IQMAX” at the bottom of the page at the above address.
I am receiving this error:
$(“a[rel^=’prettyOverlay’],a[rel^=’prettyPhoto’]”).prettyPhoto is not a function
I have checked the source code and prettyPhoto seems to be in the right place. I am assuming that I am missing something obvious since I’m new to WordPress.
This plugin is exactly what my client wants, so any help would be greatly appreciated.
Thank you so much for this plugin 🙂
A little more information on the issue you are having would help. Which method are you using? What error do you get? what are you trying to achieve with the plugin?
Ive really been trying to get this plugin to work in the way laid out in the pdf but it just wont allow me to use it ?? why i do not know.
Nice job!
Is there any gallery options??
Thanks!
wonderful plugin… thanks..:)
thanks for plugin….is impossible if there is a video created for the http://www.smugmug.com/
Never tested it so not sure.
Will this work with WordTube shortcodes?
Thanks for this nice video lightbox plugin.
Hi tipsandtricks guys,
This is awesome. I’ve made note of where you are so I can come back again and find more neat stuff for my blog.
This light box is awesome!
All the best,
Alan
Thanks for this awesome plugin. Now I can embed all my videos using this plugin.
Hi Kim, yeah you should be able to embed any flash videos (see the embedding a flash video in the usage guide)
You guys are fabulous!
So this will work with Amazon S3 videos too?
Thanks for another great product!
This is awesome – I’ve been looking for a way to.make video viewable for iPads and iPhones for ages! Thanks so much.
OMG! Thank you so much for this plugin… I have been searching for two days to get a fix for this!