flashvars are supported on the Lightbox settings page, but they are applied to all Lightbox links. some flashvars are meant to be different for each link (e.g. preview image, description, author, etc -- http://developer.longtailvideo.com/trac/wiki/FlashVars).

we need a way of adding additional flashvars on a case-by-case basis, in addition to the "universal" flashvars on the Lightbox settings page.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ncy’s picture

Status: Active » Needs review
FileSize
899 bytes

here's a patch -- it introduces an optional new attribute "flashvars" for each Lightbox link. it adds these flashvars to the flashvars that are set on the Lightbox settings page.

example use:

<a href="http://example.com/files/video.flv" rel="lightvideo[width:480px; height:420px;][this is the video caption!]" flashvars="&image=http://example.com/files/preview_image.png" >this is the link text</a>

-nick

jfolwarski’s picture

I just wanted to say thanks for posting this patch. It worked great me.

jfolwarski’s picture

As a side note did you have any problems using this patch in IE? My flash player disappears and is replaced with a white box with a scroll bar. Any solutions?

jfolwarski’s picture

I just got it to work as in IE now. It was a problem with the way I entered in the flashvars. I can't say exactly now I screwed it up so only IE wouldn't work. It does work though with the correct formatting of the flashvars.

ncy’s picture

glad i could help! :) thanx also for the update posts on IE

cheers,
-nick

gburnham’s picture

I would also like to add my voice to the chorus of Thank Yous. You solved my problem (http://drupal.org/node/304560#comment-1458286) as well nyc - thanks.

Greg

ecantelo’s picture

Sorry for being a dolt, but I've been teaching myself all this to build my own website. Could you tell me where the patch goes within the lightbox.js file? I've been trying to use lightbox2 for embedded Vimeo videos and it's proved to be a rocky road.

Thanks so much, will appreciate any and all help!

ncy’s picture

you should be able to use the "patch" command to update the old file to the new one. if you want to do it manually, the lines with a + mean lines that should be added.

on Windows, you can install Cygwin to patch. http://drupal.org/node/32875

hth

ecantelo’s picture

Well after ignoring my website for months, I'm back at it. Let's see, I'm on a mac using dreamweaver and cannot find this "patch" command you speak of. So if I add the + lines manually, where in the lightbox.js do I insert them? Or should I be including them in js in the first place? Any help would be much appreciated, I basically have little to no idea what I'm doing, so thanks for your patience. :)

ncy’s picture

i recommend using the patch command. less room for error. here's a guide for mac OSX

http://drupal.org/node/60818

basically, you have to open up a Terminal (should be located in applications->utilities i think?).

so basically something like:

$ patch -p0 < lightbox2_361870.patch

but i think you need to be in the right directory with files in the right places.

ecantelo’s picture

Thanks for the patch details. Just realized part of the problem is that I've got lightbox 2.04, and the patch looks like it is for version 2.0 - Any suggestions? Can I just go into the patch and change the file name from 2 to 2.04? I have no idea! :) Greatly appreciate the help!

ncy’s picture

the filename is lightbox.js in the js folder. it shouldn't make changes to any other file.

if you really want to do it the old-school manual way, just look in the patch file at the lines around the + lines. those are the context lines so you know where you are in the code. and add in those + lines.

i haven't looked at 2.04, but i assume there hasn't been much change to the lightbox.js file?

ecantelo’s picture

Yeah, I don't know if this is the full patch, but this is the only line of code it added when I ran the patch:

if (rel_parts["flashvars"])
Lightbox.flvFlashvars = Lightbox.flvFlashvars + '&' + rel_parts["flashvars"];

Does that seem right to you? I STILL can't seem to get embedded vimeo content to work with it though. Any ideas?

This is exactly what vimeo gives me and I'm not fully sure where to add it, if I use a href or I've seem some writing on using emfields - but I have no idea how to activate them. And this goes to show you how little I know, I can't figure out how to show the embedding vimeo code without this site trying to implement the code into this post... Arghh, if you need it I would be more than happy to directly email you.

(And again I'm on, Mac osx, using dreamweaver CS3, lightbox 2, and embedded vimeo content)

Thanks so much for all your help and patience, I am utterly clueless when it comes to this stuff. If you know anyone in Los Angeles who knows this stuff, let me know! :)

ncy’s picture

FileSize
40.69 KB

seems like it should've added more than that ... i'm attaching my lightbox.js file. my lightbox version is 6.x-1.9

vimeo content? is that your goal? this patch might not be necessary in this case i think?

check out this screencast:

http://mustardseedmedia.com/podcast/episode22

it uses emfield, CCK, and Views.

ecantelo’s picture

Thanks, that was really helpful!

I also recently discovered "Video LightBox", that actually generates everything you need, thumbnails, code, etc for a lightbox like effect that works great with Vimeo videos - It's definitely got some bugs and really weird file organization, but quite a relief for a web-design laymen like myself. I hope this helps someone else!

http://videolightbox.com/

Cheers!

jrust’s picture

Works great for me as well. Many thanks.

jrust’s picture

FileSize
1.33 KB

Encountered a problem with the original solution which is that TinyMCE strips out the flashvars attribute because it's not a valid attribute for an anchor tag (and I imagine this would also cause a page not to validate against W3C). So, I've attached a patch which makes flashvars an optional style attribute in the rel part. Example:

<a href="foo.flv" rel="lightvideo[|width: 300px; height: 300px; flashvars: image=thumb.png;]">watch</a>

This passes through TinyMCE without any problems and has the added benefit of keeping all the lightvideo settings in the same part of the tag.

jrust’s picture

FileSize
1.91 KB

Updating the patch to fix a couple bugs that popped up, specifically that in IE the video wasn't playing at all when the thumbnail was passed.

stella’s picture

Status: Needs review » Fixed

Committed, thanks!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

m4olivei’s picture

Version: 6.x-1.9 » 6.x-1.11

Hey,

Great that this patch got in, thanks a bunch. I'm using 6.x-1.11.

I found there is a small gotcha with this patch however. If your showing your videos in a group, the unique flashvars per link only apply to the first video that is opened up in the lightbox. For example say I have the following two video links:

<a rel="lightvideo[gallery|flashvars: image=penguins.jpg;][Test Video 1]" href="video_1.flv">Test Video 1</a>
<a rel="lightvideo[gallery|flashvars: image=hydrangeas.jpg;][Test Video 2]" href="video_2.flv">Test Video 2</a>

If I click 'Test Video 1' the lightbox correctly opens using the flashvars in its rel attribute and shows the preview image of pegunins.jpg. If I then flip to the next video inside the lightbox, the flashvars remain the same and the preview image is still penguins.jpg, when it should change to be hydrangeas.jpg.

The work around is of course to not use grouping, however thats less than ideal. If anyone can see something I'm doing wrong please let me know, otherwise, if our client comes back and says they need the grouping, I'll look at creating a patch. From the limited debugging I've done so far, the issue seems to stem from the fact that Lightbox.parseRel() isn't called as part of a slide flip.

Thanks,
Matt