FLV Flashvars for Individual Videos

ncy - January 21, 2009 - 05:31
Project:Lightbox2
Version:6.x-1.9
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:needs review
Description

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.

#1

ncy - January 21, 2009 - 05:36
Status:active» needs review

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

AttachmentSize
lightbox2_361870.patch 899 bytes

#2

Pathol2187 - February 4, 2009 - 16:42

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

#3

Pathol2187 - February 4, 2009 - 16:57

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?

#4

Pathol2187 - February 4, 2009 - 17:27

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.

#5

ncy - February 4, 2009 - 19:53

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

cheers,
-nick

#6

gburnham - April 9, 2009 - 22:51

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

#7

ecantelo - July 31, 2009 - 00:43

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!

#8

ncy - August 4, 2009 - 22:10

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

#9

ecantelo - September 6, 2009 - 18:55

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. :)

#10

ncy - September 7, 2009 - 17:59

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.

#11

ecantelo - September 7, 2009 - 19:11

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!

#12

ncy - September 8, 2009 - 02:22

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?

#13

ecantelo - September 8, 2009 - 16:55

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! :)

#14

ncy - September 8, 2009 - 18:39

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.

AttachmentSize
lightbox.js.txt 40.69 KB

#15

ecantelo - September 9, 2009 - 23:23

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!

#16

jrust - November 10, 2009 - 01:57

Works great for me as well. Many thanks.

#17

jrust - November 10, 2009 - 19:04

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.

AttachmentSize
lightbox2_361870_2.patch 1.33 KB

#18

jrust - November 13, 2009 - 19:07

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.

AttachmentSize
lightbox2_361870_3.patch 1.91 KB
 
 

Drupal is a registered trademark of Dries Buytaert.