Not signed in (Sign In)

Vanilla 1.0.3 is a product of Lussumo. More Information: Documentation, Community Support.

    • CommentAuthorjhcbiinoc
    • CommentTimeFeb 22nd 2008
     
    Hi,

    I am trying to use SWFObject to embed videos which are being hosted on AWS. Here are two different pages, can someone please look at my code and tell me what, if anything I am doing that is causing this?

    Example 1 (The one that works, using flvplayer.swf):

    http://clubblueneon.com/INDEX/cbn/0/flv

    Source:

    This is in the <head> tag, for this I used "flashobject":

    <!-- FlashObject embed by Geoff Stearns geoff@deconcept.com http://blog.deconcept.com/ -->
    <script type="text/javascript" language="JavaScript" src="/themes/cbn/js/flashobject.js"></script>

    And here is where the video is placed:

    <div id="flvpreviewbox">
    <!-- this appears if user doesn't have JavaScript enabled, or doesn't have the required Flash Player version -->
    <p>Please upgrade to the latest version of <a href="http://www.macromedia.com/go/getflashplayer/" target="_blank">Flash Player</a>.</p>
    <p><a href="?detectflash=false">Click here</a> if you already have Flash Player installed.</p>
    </div>

    <script type="text/javascript">
    // <![CDATA[
    var fo = new FlashObject("/themes/cbn/images/flv/flvplayer.swf", "flvplayer", "480", "360", "8", "#ffffff");
    fo.addParam("base", "http://videos.clubblueneon.com.s3.amazonaws.com/");
    fo.addVariable('file', 'http://videos.clubblueneon.com.s3.amazonaws.com/MartiniGlass.flv');
    fo.addVariable('autostart','true');
    fo.addVariable('repeat', 'true');
    fo.write("flvpreviewbox");
    // ]]>
    </script>

    (This page actually opens in a 480x360 window and works fine.)

    Example 2: Here is the page and the code for one that works with an flv file hosted on the same server as the site:
    http://clubblueneon.com/INDEX/cbn/0/
    Again, in the <head> I have:

    <!-- FlashObject embed by Geoff Stearns geoff@deconcept.com http://blog.deconcept.com/ -->
    <script type="text/javascript" language="JavaScript" src="/themes/cbn/js/flashobject.js"></script>

    And in the page:

    <!-- flash video holder area -->
    <div id="flashvideolanding">
    <!-- this appears if user doesn't have JavaScript enabled, or doesn't have the required Flash Player version -->
    <p>Please upgrade to the latest version of <a href="http://www.macromedia.com/go/getflashplayer/" target="_blank">Flash Player</a>.</p>
    <p><a href="?detectflash=false">Click here</a> if you already have Flash Player installed.</p>

    </div>

    <script type="text/javascript">
    // <![CDATA[

    var fo = new FlashObject("/themes/cbn/images/flv/FLVPlayer_Progressive.swf", "FLVPlayer_Progressive.swf", "220", "320", "6", "#ffffff");
    fo.addParam("base", "/themes/cbn/images/flv/");
    fo.addParam('file', 'HomepageWalkandTalk.flv');
    fo.addParam('wmode', 'transparent');
    fo.addVariable ("FlashVars", "&MM_ComponentVersion=1&skinName=Clear_Skin_1&streamName=HomepageWalkandTalk&autoPlay=true&autoRewind=false");
    fo.addVariable('autostart','true');
    fo.addVariable('repeat', 'true');
    fo.write("flashvideolanding");

    // ]]>
    </script>
    And this works great as well.

    But, in this final example, when I try to use the second player, nothing is happening. I have tried using both flashobject and the latest SWFObject to no avail:

    http://clubblueneon.com/INDEX/cbn/0/reviewerPage

    <!-- FlashObject embed by Geoff Stearns geoff@deconcept.com http://blog.deconcept.com/ -->
    <script type="text/javascript" language="JavaScript" src="/themes/cbn/js/swfobject.js"></script>

    <!-- flash video holder area -->
    <div id="flashvideo">
    <!-- this appears if user doesn't have JavaScript enabled, or doesn't have the required Flash Player version -->

    <p>Please upgrade to the latest version of <a href="http://www.macromedia.com/go/getflashplayer/" target="_blank">Flash Player</a>.</p>
    <p><a href="?detectflash=false">Click here</a> if you already have Flash Player installed.</p>
    </div>
    <script type='text/javascript'>
    var so = new SWFObject('/themes/cbn/images/flv/FLVPlayer_Progressive.swf', 'FLVPlayer_Progressive', '220', '320', '8');
    so.addParam('base', 'http://videos.clubblueneon.com.s3.amazonaws.com/');
    so.addVariable('file', 'Clubs.flv');
    so.addVariable ('FlashVars', '&MM_ComponentVersion=1&skinName=Clear_Skin_1&streamName=Clubs&autoPlay=true&autoRewind=false');
    so.addVariable('type', 'flv');
    so.addVariable('autostart','true');
    so.addVariable('repeat', 'true');
    so.addParam('wmode', 'transparent');
    so.addParam('allowScriptAccess', 'always');
    so.write('flashvideo');
    </script>
    </div>
    <!-- end flash video area -->

    Can someone please help me out on this?

    Thanks very much for any advice you can offer!
    • CommentAuthorphilip
    • CommentTimeFeb 22nd 2008 edited
     
    your last link (http://clubblueneon.com/INDEX/cbn/0/reviewerPage) works for me in IE6 and FF2 (WinXP)... i see a video. are you trying to play TWO videos? if you want to embed two SWFs on the same page, follow the instructions here: http://blog.deconcept.com/swfobject/forum/discussion/2/swfobject-faq/#Item_2

    other thoughts:

    you should definitely stick with SWFObject 1.5.1, as it has many improvements and bug fixes.

    RE: your embed code, your addVariables are a little scrambled. anything in an addVariable statement will be added to Flash's FlashVars, so you shouldn't use addVariable('FlashVars', ' ... ');

    your code:

    var so = new SWFObject('/themes/cbn/images/flv/FLVPlayer_Progressive.swf', 'FLVPlayer_Progressive', '220', '320', '8');
    so.addParam('base', 'http://videos.clubblueneon.com.s3.amazonaws.com/');
    so.addVariable('file', 'Clubs.flv');
    so.addVariable ('FlashVars', '&MM_ComponentVersion=1&skinName=Clear_Skin_1&streamName=Clubs&autoPlay=true&autoRewind=false');
    so.addVariable('type', 'flv');
    so.addVariable('autostart','true');
    so.addVariable('repeat', 'true');
    so.addParam('wmode', 'transparent');
    so.addParam('allowScriptAccess', 'always');
    so.write('flashvideo');


    should be changed to:


    var so = new SWFObject('/themes/cbn/images/flv/FLVPlayer_Progressive.swf', 'FLVPlayer_Progressive', '220', '320', '8', "#000000");
    so.addParam('base', 'http://videos.clubblueneon.com.s3.amazonaws.com/');
    so.addParam('wmode', 'transparent');
    so.addParam('allowScriptAccess', 'always');
    so.addVariable('file', 'Clubs.flv');
    so.addVariable('MM_ComponentVersion', '1');
    so.addVariable('skinName', 'Clear_Skin_1');
    so.addVariable('streamName', 'Clubs');
    so.addVariable('autoPlay', 'true');
    so.addVariable('autoRewind', 'false');
    so.addVariable('type', 'flv');
    so.addVariable('autostart','true');
    so.addVariable('repeat', 'true');
    so.write('flashvideo');


    note that i specified a background color (#000000); background color is a required SWFObject parameter. (don't worry, if you use wmode=transparent, the SWF will ignore the background color parameter, so it shouldn't hurt to include it.)

    - philip
    • CommentAuthorjhcbiinoc
    • CommentTimeFeb 22nd 2008
     
    Thank you Philip, much appreciated. I have downloaded the latest SWFObject and am using it now. For the moment, we had uploaded the player and the skin to the AWS server, and that is why you were able to see the video as that worked. However, I will try your code, as we really prefer to have the player and skin hosted in the root on our servers rather than on AWS. I figured that it was something I had done with the variables creating an issue.