added icecast xslt to get the current track
authorJean-Philippe Orsini <jeanfi@gmail.com>
Tue, 19 Jan 2016 12:18:33 +0000 (13:18 +0100)
committerJean-Philippe Orsini <jeanfi@gmail.com>
Tue, 19 Jan 2016 12:18:33 +0000 (13:18 +0100)
icecast2/web/current.xsl [new file with mode: 0644]

diff --git a/icecast2/web/current.xsl b/icecast2/web/current.xsl
new file mode 100644 (file)
index 0000000..a8d6e1c
--- /dev/null
@@ -0,0 +1,3 @@
+<!-- Inspirated from https://linge-ma.ws/update-listeners-track-on-a-website-using-icecast-jsonp-and-jquery/ -->\r
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">\r
+<xsl:output omit-xml-declaration="yes" method="text" indent="no" media-type="text/javascript" encoding="UTF-8"/><xsl:strip-space elements="*"/><xsl:template match="/icestats">parseMusic({<xsl:for-each select="source">"<xsl:value-of select="@mount"/>":{"title":"<xsl:if test="artist"><xsl:value-of select="artist"/> - </xsl:if><xsl:value-of select="title" />" }<xsl:if test="position() != last()"><xsl:text>,</xsl:text></xsl:if></xsl:for-each>});</xsl:template></xsl:stylesheet>\r