3

First of all my site does not use Drupal.So any alternatives for a popup video player funcionality would be appreciated.

I want to show a popup you tube video player in my web page.I downloaded lighbox from the following link: http://ftp.drupal.org/files/projects/lightbox2-6.x-1.11.zip

I extracted the zip file into my sites root

I added the following lines in my page header:

<link type="text/css" rel="stylesheet" media="all" href="/lightbox2/css/lightbox.css?1" />

<script type="text/javascript" src="/lightbox2/js/auto_image_handling.js?1"></script>
<script type="text/javascript" src="/lightbox2/js/lightbox_video.js?1"></script>
<script type="text/javascript" src="/lightbox2/js/lightbox.js?1"></script>

and the following in the body:

<a href="http://www.youtube.com/watch?v=0gBtF_awV2o" rel=lightvideo[width:500px;height:400px;]>
    <img src="sample" alt="Live TV">
</a>

But the video opens up in a new tab and not as a popup.Where am i going wrong?I cant find tutorials for this anywhere, although i have this kind of code in many other pages with popup videos.

Edit: Used shadowbox. Opens up youtube page instead of popup!

Edit: Problem solved! Got Shadowbox to work. It's brilliant and easy. The commercial licence costs $20 though.

João Pesce
  • 2,424
  • 1
  • 24
  • 26
humblePilgrim
  • 1,818
  • 4
  • 25
  • 47
  • Check out my answer @ http://stackoverflow.com/questions/11548589/using-lightbox2-to-display-video/41740013#41740013 – peppertom Jan 19 '17 at 11:04

4 Answers4

0

The reason it doesn't work is because the lightbox.js file included in the Drupal module is a modified version that uses the Drupal.settings variable, which if you don't use Drupal, is undefined.

Peter
  • 13,733
  • 11
  • 75
  • 122
0

Lightbox2 video does work in drupal.

You have to enable video support in the lightbox2 settings The url: yourdrupal.com/admin/config/user-interface/lightbox2

The flv player should be empty if you don't have one.

0

I would download Lightbox 2 from here and see if it works any better.

Trevor
  • 55,264
  • 2
  • 18
  • 12
0

You probably are either not calling jQuery or lighbox correctly.

Make sure the have the two src correct.

I'm not sure I understood your question but you cant display video with lightbox, it says so in the FAQ and it recommends thickbox.

You could also use something videolighbox or any out there.

Good luck!

Trufa
  • 39,971
  • 43
  • 126
  • 190
  • @Trevor is right, it's always better to download from the original sourde see [His answer](http://stackoverflow.com/questions/4691700/how-to-use-lightbox2-to-show-video-in-my-page/4692446#4692446) – Trufa Jan 14 '11 at 15:12
  • The guys at thick box say that i should use shadowbox.I did, but to no avail! – humblePilgrim Jan 14 '11 at 15:49
  • But its commercial version is paid.Plus the site that i was given for reference uses LightBox2.So my client would probably prefer such a solution – humblePilgrim Jan 14 '11 at 16:12
  • @Mithun Madhav Oh! hadn't though about that (always personal in my case) anyway glad you found it! – Trufa Jan 14 '11 at 16:14