Open a video lightbox popup on page load and autoplay then close the popup automatically on video end

Product:

WonderPlugin Lightbox

Tutorial:

This tutorial will guide you how to open a video lightbox popup on page load, play the video then close the popup automatically after the video has finished playing.

Please note, video autoplay does not work mobile and tablet devices, for example, iPhone, iPad and Android.

In your WordPress post or page editor, switch to Text mode, then enter the following code:

<a href="https://www.wonderplugin.com/videos/demo-video0.mp4" class="wplightbox" data-width=960 data-height=544 data-autoopen="true" data-autoopendelay=1000 data-autoclose="true">Click to open an MP4 video in a Lightbox</a>

In the above code, the class name class="wplightbox" activates the lightbox on the link.

The data attribute data-width=960 and data-height=544 specify the size of the popup, data-autoopen="true" automatically opens the lightbox on page load, data-autoopendelay=1000 defines the open delay in milliseconds, data-autoclose="true" closes the popup after the video has finished playing.

If you want to hide the lightbox link, you can place the code into a hidden div, for example:

<div style="display:none">
<a href="https://www.wonderplugin.com/videos/demo-video0.mp4" class="wplightbox" data-width=960 data-height=544 data-autoopen="true" data-autoopendelay=1000 data-autoclose="true">Click to open an MP4 video in a Lightbox</a>
</div>

To view the online demo, please visit video popup and auto close demo.