views:

43

answers:

1

I am trying to get a youtube video to play in a fancybox popup window. The popup window comes up okay, but the video does not play. Firebug indicates that all the necessary elements are loading, but no video.

On this page everything works fine.

On this page the window pops up but no video.

Here is the html:

<div id="play-btn">
   <a class="play-video" href="#flashArea1">Play Video</a>
</div>
<div style="display:none">
<div id="flashArea1" class="flashArea1" style="height:376;"><p>This content requires the Adobe Flash Player.<br /><a href="http://www.adobe.com/go/getflashplayer"&gt;
<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /><br />Get Flash</a></p>
</div>

<script type="text/javascript">
var mainswf = new SWFObject("youtube_player_standalone.swf", "main", "600", "250", "9", "#000000");
mainswf.addParam("scale", "noscale");
mainswf.addParam("wmode", "window");
mainswf.addParam("allowFullScreen", "true");
mainswf.addVariable("youtube_id", "_EC2tmFVNNE");
mainswf.addVariable("title", "Harry Potter and the Deathly Hallows");
mainswf.addVariable("controls_always_on", "false");
mainswf.addVariable("controls_fade_out_time", "5");
mainswf.addVariable("volume_cookie_on", "true");
mainswf.write("flashArea1");
</script>
</div><!-- end flash -->

Here is the jQuery that pops up the box:

<script type="text/javascript">
$(document).ready(function() {
$("a.play-video").fancybox({
'hideOnContentClick': false
});
});
</script>

I would appreciate any assistance. Thanks.

A: 

try validating your page also for some reason you have php code showing up in your source I would fix that stuff first then maybe your youtube will show

you have two instances of the same swf code in your html try pitching one of them

ie

<div style="display:none">
<div id="flashArea3" class="flashArea3" style="height:376;"><p>This content requires the Adobe Flash Player.<br /><a href="http://www.adobe.com/go/getflashplayer"&gt;
                        <img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /><br />Get Flash</a></p>

    </div>

  <script type="text/javascript">
    var mainswf = new SWFObject("youtube_player_standalone.swf", "main", "600", "250", "9", "#000000");
    mainswf.addParam("scale", "noscale");
    mainswf.addParam("wmode", "window");
    mainswf.addParam("allowFullScreen", "true");
    mainswf.addVariable("youtube_id", "_EC2tmFVNNE");
    mainswf.addVariable("title", "Harry Potter and the Deathly Hallows");
    mainswf.addVariable("controls_always_on", "false");
    mainswf.addVariable("controls_fade_out_time", "5");
    mainswf.addVariable("volume_cookie_on", "true");
    mainswf.write("flashArea3");
  </script>

mcgrailm
I disabled the php - that is for bringing in Wordpress blog feeds. The page validates, but still no video.
fmz
@fmz see edit above
mcgrailm
Right now they all reference the same file player swf file, but all instances have unique IDs.
fmz
yes but the variable names and all the code are the same.. just try it and see if it fixes the problem ?
mcgrailm
I removed it and the problem persists. I appreciate your efforts.
fmz
hmm ok well you are loading a flash item in there but your getting an error loading http://www.theideapeople.com/projectpath/ideapeople-new/youtube_player_standalone.swf
mcgrailm
That is the default player. The parameters are determined by the settings in the page.
fmz
out of curiosity when you took out the extras did you take out all the extras or just one ?
mcgrailm
@fmz did you get this working ?
mcgrailm