Using Lightbox2 to display video

Website: http://blieque.comli.com/motion

Before I start, I know that there are many alternatives to Lightbox2 (Lokesh Dhakar's) for showing the video, but I want to avoid using three different JavaScript things already using MooTools and JQuery, as I want the HTTP requests to be minimal as well disk usage.

Like everything, Lightbox2 does not support video, full stop. However, I noticed that JavaScript essentially took the contents of the attribute a hrefand put it in the attribute img srcwhen the box was opened. As far as I can see, changing this imgto iframe(done) and setting the anchor tag hrefto youtube.com/embed/*video-id*should generate a iframecontaining YouTube video (replacing watch?id=with embed/represents a full-screen version of the video.

Then I also added JavaScript for the width, height and frameborder attributes on top of the standard one class="lb-image". Now that the page is loaded and the called Lightbox creates an empty window. If you check the code, you will see all the attributes, but the page in the frame frame is not loaded, just creating an empty tag headand body.

I'm just wondering if there was a server problem or a problem with the code, and if so, how to fix it. If there is a way to make it work?

thank

Note. I DO NOT use Drupal, so the option is lightvideonot available.

+3
source share
1 answer

Enabling Video Support

By default, video support is disabled. However, this can be easily enabled by setting the option to enable video support in admin / settings / lightbox2.

Basic example

<a href="http://video.google.com/videoplay?docid=1811233136844420765" rel="lightvideo">This Video</a>

Link

-6
source

Source: https://habr.com/ru/post/1785445/


All Articles