0

I'm trying to load an h264 mp4 into fancybox lightbox - is there a way to do this? If not - how would I do this by uploading video to youtube or vimeo? I see it's on the roadmap, not sure if there's a way I could improvise for the time being.

EDIT - This is my code based on the suggested answer below, which does not capture the href of the link. I need to know how to capture the href.

$(".galleryVideo").fancybox({
        'padding' : 0, // optional
        'title' : this.title,
        'content': '<embed src="{site_url}js/jw/jwplayer.swf?file='+this.href+'&amp;autostart=true&amp;fs=1" type="application/x-shockwave-flash" width="444" height="250" wmode="opaque" allowfullscreen="true" allowscriptaccess="always"></embed>'               
});
mheavers
  • 29,530
  • 58
  • 194
  • 315

1 Answers1

2

You need a swf player in any case. You may use jwplayer for instance and if you do so, check this thread to get an idea how to use it with fancybox.

Community
  • 1
  • 1
JFK
  • 40,963
  • 31
  • 133
  • 306
  • Thanks - my setup is a bit different in that I am generating a list of videos and photos via a CMS, and so the links will not necessarily be clicked. As such - I've added my modified code above. The problem is that the value of href, using this method, is undefined. How would I capture that value properly without a jquery "click" function? – mheavers Jan 19 '12 at 13:53
  • I guess you would need to pass the name of the file through a variable to replace the href so instead of this _?file='+this.href+_ to have something like _?file='+myFile+_ but it's a guess since you don't provide too much code – JFK Jan 28 '12 at 23:34