umbraco Forum
  •   Welcome Guest
  • Search
  • Active Topics
  • Log In
  • Register

umbraco Forum » Extending umbraco » Extending umbraco » update tags in xslt?

update tags in xslt? Options
Previous Topic · Next Topic
detour522
Posted: Wednesday, November 22, 2006 6:17:52 AM
Rank: Newbie

Joined: 11/22/2006
Posts: 1
i have a macro which displays a list of media files i have uploaded. is there any way i can have just one embedded media player and update the media player when i select a file on the same page?

i was trying to use some javascript to update the embedded object but now i don't think its possible to update any of the <param> tags once the page has been loaded. can this be done in javascript?

Paul
Back to top
 
howard
Posted: Wednesday, November 22, 2006 4:51:57 PM
Rank: Devotee

Joined: 8/22/2006
Posts: 72
Hi,

I have implemented an xml based flash media player (could also do with video) using the xspf (XML Shareable Playlist Format) standard. I have a template with a Macro that generates (via an xslt file) a compliant file listing all the relevant media content. The player loads the playlist by linking to the url (e.g. playlist.aspx).

You can then pass on a query string from your hyperlinks the file info to play. This can be generated in the xslt.

I also add the XSPF Plylist as an individual Document Type

player
http://musicplayer.sourceforge.net/

XSPF Schema
http://www.xspf.org/schema/

Example Template to Load Macro

Code:
<?xml version="1.0" encoding="UTF-8"?>
<playlist version="1" xmlns="http://xspf.org/ns/0/">
    <trackList>
    <?UMBRACO_MACRO macroAlias="XSPFPlaylistGen" domain="http://localhost/umbraco_stmutants"></?UMBRACO_MACRO>
    </trackList>
</playlist>



Example Macro XSLT
Code:

<?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="xml" omit-xml-declaration="yes"/>

<xsl:param name="currentPage"/>
<xsl:variable name="domain" select="/macro/domain"/>
<xsl:variable name="catType" select="$currentPage/ancestor-or-self::node [@nodeTypeAlias = 'wwMusic']/node"/>


<xsl:template match="/">

<!-- Generate XML doc for track list player -->

<xsl:for-each select="$catType">
    <xsl:sort select="./data [@alias = 'relDate']" order="descending"/>
    <xsl:if test="string(data [@alias='umbracoNaviHide']) != '1'">

    <track>
            <location><xsl:value-of select="$domain"/><xsl:value-of select="umbraco.library:GetMedia(./data [@alias ='audioFile'],0)/data [@alias = 'umbracoFile']"/></location>

            <!-- name of the song -->
            <title><xsl:value-of select="@nodeName"/></title>

        </track>

</xsl:if>
</xsl:for-each>

</xsl:template>

</xsl:stylesheet>






Back to top
 
warren
Posted: Wednesday, November 22, 2006 5:17:49 PM

Rank: Addict

Joined: 7/19/2006
Posts: 820
Location: Benfleet, Essex, UK
I done this quite a while ago using querystrings as well.

http://cms2.momo.co.uk/video-gallery/hoff-2.aspx

<embed src="/assets/flash/umbraco_vid_viewer.swf?Src=/media/499/hoff2.flv"/>

Warren Buckley an Umbraco MVP 08-09 & level 1 certified developer
Back to top
 
Users browsing this topic
Guest

umbraco Forum » Extending umbraco » Extending umbraco » update tags in xslt?


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.
Watch this topic
RSS Feed
Email this topic
Print this topic
Threaded
Normal

  • XHTML
  • CSS
© 2001-2008 Umbraco. Forum based on YetAnotherForum.net.