Copied to clipboard

Flag this post as spam?

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


  • Graeme Paul 44 posts 64 karma points
    Mar 16, 2011 @ 12:11
    Graeme Paul
    0

    Xslt Umbraco mediacurrent getmedia problem flash player

     

    I'm having some problems with mediacurrent in xslt, In my flash player it renders the url link but with the file type and size attributes. It renders something like /media/7299/blah_blah.swfswf172228.

    Ive tried changing the variable name with getmeda as below, but still no luck..

    <xsl:variable name="videopath" select="umbraco.library:GetMedia($currentPage/data [@alias='Video'], 'false')/data [@alias = 'umbracoFile']"/>

     

    Any suggestions? Below is the rest of my code and im using umbraco 4.6.1

     

    <xsl:param name="currentPage"/>
      <xsl:variable name="videopath" select="/macro/video"/>
      <xsl:variable name="videowidth" select="/macro/width"/>
      <xsl:variable name="videoheight" select="/macro/height"/>
     
    <!-- ============================================================= -->
    <xsl:template match="/">
    <div id="flashy"><a href="http://www.macromedia.com/go/getflashplayer">Get the Flash Player</a> to see this player.</div>
      <script type="text/javascript">
        var flashvars = {};
        var params = {
        quality: "best",
        bgcolor: "#000000",
        allowfullscreen: "true",
        wmode: "transparent"
        };
        var attributes = {};
        swfobject.embedSWF(
        "<xsl:value-of select="$videopath" />",
        "flashy",
        "<xsl:value-of select="$videowidth" />",
        "<xsl:value-of select="$videoheight" />",
        "5.0.0",
        "/harrodsstore/Flash/expressInstall.swf",
        flashvars,
        params,
        attributes);   
      </script>
    </xsl:template>
  • Kim Andersen 1447 posts 2197 karma points MVP
    Mar 16, 2011 @ 12:37
    Kim Andersen
    0

    Hi Graeme.

    Try something like this:

    <xsl:value-of select="$videopath/umbracoFile" />

    The $videopath contains the entire XML of the media node, så you need to grab the path to the file from that variable. Are you using the new XML schema?

    /Kim A

  • Graeme Paul 44 posts 64 karma points
    Mar 16, 2011 @ 15:31
    Graeme Paul
    0

    Hi Kim, i just tried what you posted and the url field is now empty? i think I am using the new xml schema

    var flashvars = {};
    var params = {
    quality: "best",
    bgcolor: "#000000",
    allowfullscreen: "true",
    wmode: "transparent"
    };
    var attributes = {};
    swfobject.embedSWF(
    "", <--- url should be here --->
    "flashy",
    params,
    attributes);

  • Tom Fulton 2030 posts 4998 karma points c-trib
    Mar 16, 2011 @ 18:10
    Tom Fulton
    0

    Hi,

    For whatever reason, when you use the mediaCurrent parameter type, it returns the media XML wrapped in another element according to it's type, such as <Image> or <File>

    So to access the properties, you need to use:

    <xsl:value-of select="$videopath/File/umbracoFile" />

    (replacing /File/ with whatever the alias of the MediaType you are using - or you can just use $videoPath/*/umbracoFile)

    Hope this helps,
    Tom

Please Sign in or register to post replies

Write your reply to:

Draft