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 594 posts 830 karma points
    Aug 31, 2010 @ 10:09
    Fredrik Esseen
    0

    Displaying video with new xsl schema

    Ive run the xsltupdater but it still doesnt work:

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp "&#x00A0;"> ]>
    <xsl:stylesheet
     version="1.0"
     xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
     xmlns:msxml="urn:schemas-microsoft-com:xslt"
     xmlns:umbraco.library="urn:umbraco.library"
     exclude-result-prefixes="msxml umbraco.library">

    <xsl:output method="html" omit-xml-declaration="yes"/>
    <xsl:param name="currentPage"/>
    <xsl:variable name = "vidToPlay" select="/macro/videoNodeId"/>
    <xsl:template match="/">
    <xsl:if test="$vidToPlay != '' ">
      <xsl:value-of select="videoNode"/>
      <xsl:variable name="showMe" select="umbraco.library:GetMedia($vidToPlay/node/@id, 0)/umbracoFile" />
      <div id="container" style="text-align: center;">
        <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" src="/endforward umbraco flv/jwplayer/swfobject.js" /> <!-- Move this to your template to make sure it's included only once. -->
     
      <script type="text/javascript">
        var s1 = new SWFObject("/endforward umbraco flv/jwplayer/player.swf","ply","460","290","9","#FFFFFF");
        s1.addParam("allowfullscreen","true");
        s1.addParam("allowscriptaccess","always");
        s1.addParam("flashvars","file=<xsl:value-of select="$showMe"/>");
        s1.write("container");
      </script>
    </xsl:if>
    </xsl:template>
    </xsl:stylesheet>

     

    Getmedia is the problem. What is the right syntax?

  • Chriztian Steinmeier 2726 posts 8320 karma points MVP 4x admin c-trib
    Aug 31, 2010 @ 10:14
    Chriztian Steinmeier
    0

    Hi froad,

    If the macro parameter videoNodeId is the ID of the media item (as the naming suggests), then the GetMedia call should just use that:

    umbraco.library:GetMedia($vidToPlay, 0)/umbracoFile

    /Chriztian

  • Fredrik Esseen 594 posts 830 karma points
    Aug 31, 2010 @ 10:37
    Fredrik Esseen
    0

    Thx! Much easier than I thought :)

  • Fredrik Esseen 594 posts 830 karma points
    Aug 31, 2010 @ 11:01
    Fredrik Esseen
    0

    Another stupid question (im not very good at the new schema yet)

    <xsl:variable name="videonode" select="/macro/videoNode"/>
    <xsl:variable name="videopath" select="$videonode/node/data[@alias='umbracoFile']"/>

    This is the old way to retrieve athe file. How should it be now?

    Ive tried

    <xsl:variable name="videopath" select="$videonode/node/umbracoFile"/>

    and

    <xsl:variable name="videopath" select="$videonode/umbracoFile"/>

    videonode is a mediaCurrent.

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies