English  Italiano  Français  Español  Dansk  Deutsch  Deutsch  Português  Suomi 
Video Lightbox

Play html video players when page loads

Apr 22, 2014

Q: Hello,

I am considering purchasing a commercial license, and have downloaded the free version for evaluation.

I do have a question:

Rather than have a thumbnail that needs to be clicked, is there support for the following: As soon as the page loads the video overlay also loads and starts to play immediately.

I would simply like to launch the overlay automatically without the need for the user to click a thumbnail or a text hyperlink.

A: You can do it in 2 ways:

You can start Video LightBox gallery on page load.
you should set the following function in Video LightBox BODY section:

<script type="text/javascript">
$( function(){$("#videogallery a[rel]:first").overlay().load()});
 </script>



You should also set id="mylink" for video link:

<!-- Start VideoLightBox.com BODY section -->
...
<div id="videogallery">
<a rel="#voverlay" id="mylink" href="http://www.youtube.com/v/vPisAYTubrg?autoplay=1"
title=""  style="display:none;">
<img src="data/thumbnails/0.png"><span></span></a><a id="videolb" href="http://videolightbox.com">
Video In A Lightbox by VideoLightBox.com v1.3</a></div>

 <script type="text/javascript">
$( function(){$("#videogallery a[rel]:first").overlay().load()});
 </script>

<!-- End VideoLightBox.com BODY section -->

Related