Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Fredrik Esseen 610 posts 906 karma points
    Sep 15, 2009 @ 16:30
    Fredrik Esseen
    0

    Using flashvars

    Hi!

     

    Maybe this is not the right forum for flashvar-questions but people here is so friendly :)

    Im using tje jwplayer to play flv-files on my site wich wokrs nice but now I want to add some flashvars.

    The problem is that its not working. im trying to add a preview-image but nothing happens

      <script type="text/javascript">
        var mttVid<xsl:value-of select="$vidToPlay/node/@id"/> = new SWFObject("/endforward umbraco flv/jwplayer/player.swf","ply","180","140","9","#000000");
        mttVid<xsl:value-of select="$vidToPlay/node/@id"/>.addParam("allowfullscreen","true");
        mttVid<xsl:value-of select="$vidToPlay/node/@id"/>.addParam("allowscriptaccess","always");
        mttVid<xsl:value-of select="$vidToPlay/node/@id"/>.addParam('flashvars','file=<xsl:value-of select='$showMe'/>');

        mttVid<xsl:value-of select="$vidToPlay/node/@id"/>.write("myVideo<xsl:value-of select="$vidToPlay/node/@id"/>");
      </script>

    I tried to do this:

    mttVid<xsl:value-of select="$vidToPlay/node/@id"/>.addParam('flashvars','file=<xsl:value-of select='$showMe'/>&image=http:mydomain/images/myimage.jpg');

    But then the xslt crashes of some reason. I also tried to add a variable and a param without success.

     

  • Jannik Nilsson 38 posts 81 karma points
    Sep 16, 2009 @ 09:25
    Jannik Nilsson
    0

    Try doing something like this:

    <div class="par" id="inspiration{$idNum}"></div>
    <script type="text/javascript">
    var flashvars = {file: '<xsl:value-of select="$file"/>',image: '<xsl:value-of select="$fileImage"/>',frontcolor: 'ffffff',lightcolor: 'cc9900',skin: '/swf/overlay.swf',controlbar:'none'};

    var params = {menu: 'false',allowfullscreen:'false',allowscriptaccess:'always',wmode:'opaque',bgcolor:'#002c39'};
    var attributes = {};

    swfobject.embedSWF('/swf/player.swf', 'inspiration<xsl:value-of select="$idNum" />', '290', '177', '9.0.0','/swf/expressInstall.swf', flashvars, params, attributes);
    </script>

  • Fredrik Esseen 610 posts 906 karma points
    Sep 16, 2009 @ 17:43
    Fredrik Esseen
    0

    I get an xslt error on <xsl:valueof at flashvars:

    <script type="text/javascript">
    var flashvars = {file: '<xsl:value-of select="$showme"/>',image:'http://web.u0810495.fsdata.se/images/preview',frontcolor: 'ffffff',lightcolor: 'cc9900',controlbar:'none'};
    var params = {menu: 'false',allowfullscreen:'false',allowscriptaccess:'always',wmode:'opaque',bgcolor:'#002c39'};
    var attributes = {};
    swfobject.embedSWF('/endforward umbraco flv/jwplayer/player.swf', 'mttVid<xsl:value-of select="$vidToPlay/node/@id"/>', '180', '140', '9.0.0','ply', flashvars, params, attributes);
    </script>
  • Fredrik Esseen 610 posts 906 karma points
    Sep 30, 2009 @ 13:49
    Fredrik Esseen
    0

    When I look at my source this is what gets rendered:

     <div id="myVideo1102"><a href="http://www.macromedia.com/go/getflashplayer">För att se filmen behöver du en flashspelare. Hämta den här.</a></div><script type="text/javascript">
        var flashvars = {file: '/media/995/gyrid_tone2.flv',image: '/images/preview.jpg',frontcolor: 'ffffff',lightcolor: 'cc9900',controlbar:'none'};
     
     
        var mttVid1102 = new SWFObject("/endforward umbraco flv/jwplayer/player.swf","ply","180","140","9",flashvars);
        mttVid1102.addParam("allowfullscreen","true");
        mttVid1102.addParam("allowscriptaccess","always");
         
        mttVid1102.write("myVideo1102");
      </script>

     Im no javascripter so for mer its not obvióus what is wrong. Anyone?

  • Fredrik Esseen 610 posts 906 karma points
    Sep 30, 2009 @ 21:01
    Fredrik Esseen
    0

    Solved it finally:

    <xsl:template match="/">
      <xsl:value-of select="videoNode"/>
      <xsl:variable name="showMe" select="umbraco.library:GetMedia($vidToPlay/node/@id, 0)/data [@alias = 'umbracoFile']" />
    <div id ="myVideo{$vidToPlay/node/@id}">
        <a href="http://www.macromedia.com/go/getflashplayer">För att se filmen behöver du en flashspelare. Hämta den här.</a>  </div>
     
     <script type="text/javascript">
        var mttVid<xsl:value-of select="$vidToPlay/node/@id"/> = new SWFObject("/endforward umbraco flv/jwplayer/player.swf","ply","180","140","9","#000000");
        mttVid<xsl:value-of select="$vidToPlay/node/@id"/>.addParam("allowfullscreen","true");
        mttVid<xsl:value-of select="$vidToPlay/node/@id"/>.addVariable("allowscriptaccess","always");
        mttVid<xsl:value-of select="$vidToPlay/node/@id"/>.addVariable('file','<xsl:value-of select='$showMe'/>');
        mttVid<xsl:value-of select="$vidToPlay/node/@id"/>.addVariable('image','preview.jpg');
        mttVid<xsl:value-of select="$vidToPlay/node/@id"/>.write("myVideo<xsl:value-of select="$vidToPlay/node/@id"/>");
      </script>
    </xsl:template>
Please Sign in or register to post replies

Write your reply to:

Draft