It goes almost without saying, this works perfectly in Chrome, Firefox, and Safari. IE (any version) being the problem.
Objective: I am trying to load JWplayer which loads an FLV from S3 in a Facebox popup.
jQuery(document).ready(function($) {
$('a[rel*=facebox]').facebox()
})
HTML (haml):
%li#videoGirl
= link_to 'What is HQchannel?', '#player', :rel => 'facebox'
.grid_8.omega.alpha#player{:style => 'display: none;'}
:javascript
var so = new SWFObject('/flash/playerTrans.swf','mpl','640px','360px','0');
so.addParam('allowscriptaccess','always');
so.addParam('allowfullscreen','true');
so.addParam('wmode','transparent');
so.addVariable('file', 'http://hometownquarterlyvideos.s3.amazonaws.com/whatishqchannel.flv&autostart=true&controlbar=none&repeat=always&image=/flash/video_girl/whatishqchannel.jpg&icons=false&screencolor=none&backcolor=FFFFFF&screenalpha=0&overstretch');
so.addVariable('overstretch', 'true')
so.write('player');
Problem:
My guess:
I'm thinking that the problem is with the javascript not being called at the right times. It seems it's loading the facebox without the jwplayer. At least I assume. Hence the reason why the nav is there. I thinking that it did not read the javascript for that.
This code will successfully load JWplayer after the facebox javascript is instantiated. There is still something screwy going on with video not displaying in IE7 or IE8, but JWplayer loads appropriately.
HTML:
<a class="flash" href="http://hometownquarterlyvideos.s3.amazonaws.com/whatishqchannel.flv" rel="/flash/video_girl/whatishqchannel.jpg">Flash</a>
Javascript:
$(document).ready(function(){
// click on flash video link
$('.flash').click(function(){
$.facebox('<div id="fbvideo"></div>');
var so = new SWFObject('/flash/playerTrans.swf','fbvideo','640px','360px','0');
so.addParam('allowscriptaccess','always');
so.addParam('allowfullscreen','true');
so.addParam('wmode','transparent');
so.addVariable('file', $(this).attr('href'));
so.addVariable('autostart','true');
so.addVariable('controlbar','none');
so.addVariable('repeat','always');
so.addVariable('image',$(this).attr('rel'));
so.addVariable('icons','false')
so.addVariable('screencolor','none');
so.addVariable('backcolor','FFFFFF');
so.addVariable('screenalpha','0');
so.addVariable('overstretch', 'true');
so.write('fbvideo');
return false;
})
})