Copied to clipboard

Flag this post as spam?

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


  • syn-rg 282 posts 425 karma points
    Jun 09, 2011 @ 06:48
    syn-rg
    0

    Display Quicktime using mediaCurrent in Macro

    What XSLT code do I need, to get my Quicktime video (picked using mediaCurrent in my macro), to display correctly?

    The alias is "Video" and I've uploaded the .mov as a file in my Media section.

    I'm using Umbraco version 4.3.

    Here's the code I use to display the video:

    <object classid="clsid:02bf25d5-8c17-4b23-bc80-d3488abddc6b" width="300" height="233" codebase="http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0">
    <param name="src" value="/media/85016/sample_itunes.mov" />
    <param name="autoplay" value="true" /><embed type="video/quicktime" width="300" height="233" src="/media/85016/sample_itunes.mov" autoplay="true"></embed>
    </object>

    Here's my XSLT, what do I need to get the value of the video into the necessary "value" parameters?:

    <?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" xmlns:Exslt.ExsltCommon="urn:Exslt.ExsltCommon" xmlns:Exslt.ExsltDatesAndTimes="urn:Exslt.ExsltDatesAndTimes" xmlns:Exslt.ExsltMath="urn:Exslt.ExsltMath" xmlns:Exslt.ExsltRegularExpressions="urn:Exslt.ExsltRegularExpressions" xmlns:Exslt.ExsltStrings="urn:Exslt.ExsltStrings" xmlns:Exslt.ExsltSets="urn:Exslt.ExsltSets" xmlns:memberGroupFunctions="urn:memberGroupFunctions" xmlns:UCommentLibrary="urn:UCommentLibrary" xmlns:tagsLib="urn:tagsLib" xmlns:BlogLibrary="urn:BlogLibrary"
    exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets memberGroupFunctions UCommentLibrary tagsLib BlogLibrary ">


    <xsl:output method="xml" omit-xml-declaration="yes"/>

    <xsl:param name="currentPage"/>

    <xsl:template match="/">

    <!-- start writing XSLT -->

    <object classid="clsid:02bf25d5-8c17-4b23-bc80-d3488abddc6b" width="300" height="233" codebase="http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0">
    <param name="src" value="/media/85016/sample_itunes.mov" />
    <param name="autoplay" value="true" /><embed type="video/quicktime" width="300" height="233" src="/media/85016/sample_itunes.mov" autoplay="true"></embed>
    </object>

    </xsl:template>

    </xsl:stylesheet>

     

  • Tom Fulton 2030 posts 4998 karma points c-trib
    Jun 09, 2011 @ 14:31
    Tom Fulton
    0

    Hi,

    Are you using 4.0.3?

    First you'll need to add the parameter to your XSLT, above the <xsl:template> line:

    <xsl:param name="media" select="/macro/yourMediaCurrentParameterAlias" />

    Then you should be able to access the file like so:

    <param name="src" value="{$media/node/data [@alias='umbracoFile']}"/>
    .....
    <embed type="video/quicktime" width="300" height="233" src="{$media/node/data [@alias='umbracoFile']}" autoplay="true"></embed>

    You can also add parameters for height/width/etc if you like and use them the same way.  ie height="{$heightParam}"

    Also, if you need to enforce the </embed> tag to show instead of having the tag self-close, you can change the output method from "xml" to html" on the <xsl:output> tag.

    Hope this helps,
    Tom

     

  • syn-rg 282 posts 425 karma points
    Jun 10, 2011 @ 05:44
    syn-rg
    0

    Thanks Tom!

    That is exactly what I needed. It's working perfectly now.

    Here's my final XSLT:

    <?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" xmlns:Exslt.ExsltCommon="urn:Exslt.ExsltCommon" xmlns:Exslt.ExsltDatesAndTimes="urn:Exslt.ExsltDatesAndTimes" xmlns:Exslt.ExsltMath="urn:Exslt.ExsltMath" xmlns:Exslt.ExsltRegularExpressions="urn:Exslt.ExsltRegularExpressions" xmlns:Exslt.ExsltStrings="urn:Exslt.ExsltStrings" xmlns:Exslt.ExsltSets="urn:Exslt.ExsltSets" xmlns:memberGroupFunctions="urn:memberGroupFunctions" xmlns:UCommentLibrary="urn:UCommentLibrary" xmlns:tagsLib="urn:tagsLib" xmlns:BlogLibrary="urn:BlogLibrary"
    exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets memberGroupFunctions UCommentLibrary tagsLib BlogLibrary ">


    <xsl:output method="xml" omit-xml-declaration="yes"/>

    <xsl:param name="currentPage"/>
    <xsl:param name="media" select="/macro/Video" />
    <xsl:template match="/">

    <!-- start writing XSLT -->
    <div style="margin-left:17px;">
    <object classid="clsid:02bf25d5-8c17-4b23-bc80-d3488abddc6b" width="385" height="289" codebase="http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0">
    <param name="src" value="{$media/node/data [@alias='umbracoFile']}"/>
    <embed type="video/quicktime" width="385" height="289" src="{$media/node/data [@alias='umbracoFile']}" autoplay="true" scale="tofit"></embed>
    </object>
    </div>
    </xsl:template>

    </xsl:stylesheet>
Please Sign in or register to post replies

Write your reply to:

Draft