Problems with video in fancybox

116 views
Skip to first unread message

Eric

unread,
Jun 15, 2010, 11:41:51 AM6/15/10
to fancybox
I'm having problems showing a video in fancybox.

Our video provider has instructed us to use the following code to call
the video (our site does not run at eyemaginations.com - it is on a
different domain):

<script type="text/javascript">
var so=new SWFObject("http://online.eyemaginations.com/
online.swf","tdeyeonlineswf","402","400","8","#FFFFFF");
so.addParam("wmode", "transparent");
so.addVariable("aID","54263a9993d6a4ea7628c67178ff9297");
so.write("tdeonline");
</script>

Using their code, I was able to get it to show up in fancybox in
Firefox and Chrome but in IE 8 there are problems (video doesn't reset
to the beginning when I close and then click the open link again
unless I first refresh page). I did some research and found the
suggestion to use Tip #4 at fancybox.net/blog but I have been unable
to get this working. Here is what I currently have:

<script>
$("#catv1").click(function() {
$.fancybox({
'padding' : 0,
'autoScale' : false,
'transitionIn' : 'none',
'transitionOut' : 'none',
'title' : this.title,
'width' : 402,
'height' : 400,
'href' : 'this.href.replace(new RegExp("watch\\?
v=","i"),'v/'),
'type' : 'swf',
'swf' : {
'wmode' : 'transparent'
}
});
return false;
});
</script>

<a id="catv1" href="http://online.eyemaginations.com/online.swf?
aID=54263a9993d6a4ea7628c67178ff9297" title="Cataract Video">Cataract
Video</a>

This code ends up bringing me to a new page instead of opening
fancybox and the player fills most of the page.

I've tried all sorts of variations but I can't get this to work. Can
anyone give me any suggestions? Let me know if you need any additional
info. Thanks.

Eric

JFK

unread,
Jun 15, 2010, 5:08:05 PM6/15/10
to fancybox
your script should look more like this:
<script type="text/javascript">
$(document).ready(function() {
$("#catv1").click(function() {
$.fancybox({
'padding' : 0,
'autoScale': false,
'transitionIn': 'none',
'transitionOut': 'none',
'title' : this.title,
'width' : 420,
'height': 400,
'href': this.href,
'type' : 'swf',
'swf': {'wmode':'transparent'}
});
return false;
});
}); //ready
</script>

the code above is likely the one you need and works for this link:
<a id="catv1" href="http://online.eyemaginations.com/online.swf?
aID=54263a9993d6a4ea7628c67178ff9297" title="Cataract Video">Cataract
Video</a>

your other script didn't work at all because you have some quotes that
you don't need in the "href" option

Eric

unread,
Jun 15, 2010, 5:41:33 PM6/15/10
to fancybox
Thank you JFK!! I see the problem now - the extra single quote I had
in front of the "href" option. Figures a dumb typo messed me up! I
made the extra changes you suggested and it works perfectly now.

Eric
Reply all
Reply to author
Forward
0 new messages