summaryrefslogtreecommitdiff
path: root/templates/www.youtube.com/description.xsl
diff options
context:
space:
mode:
authorAntti Ajanki <antti.ajanki@iki.fi>2010-10-24 21:05:47 +0300
committerAntti Ajanki <antti.ajanki@iki.fi>2010-10-24 21:05:47 +0300
commit4770a7e7d1a06fcea280382c546ae38cf4fd084e (patch)
tree9fd5b235a907edf4c76ceaf769d0cdbe501399c6 /templates/www.youtube.com/description.xsl
parent439024953d1abe71fd5adce26fac4f17c1aa9f96 (diff)
downloadvdr-plugin-webvideo-4770a7e7d1a06fcea280382c546ae38cf4fd084e.tar.gz
vdr-plugin-webvideo-4770a7e7d1a06fcea280382c546ae38cf4fd084e.tar.bz2
rename template directories and add videopage.xsl to each template
Diffstat (limited to 'templates/www.youtube.com/description.xsl')
-rw-r--r--templates/www.youtube.com/description.xsl73
1 files changed, 73 insertions, 0 deletions
diff --git a/templates/www.youtube.com/description.xsl b/templates/www.youtube.com/description.xsl
new file mode 100644
index 0000000..6567adb
--- /dev/null
+++ b/templates/www.youtube.com/description.xsl
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:str="http://exslt.org/strings"
+ xmlns:atom="http://www.w3.org/2005/Atom"
+ xmlns:media="http://search.yahoo.com/mrss/"
+ xmlns:gd="http://schemas.google.com/g/2005"
+ xmlns:yt="http://gdata.youtube.com/schemas/2007"
+ exclude-result-prefixes="atom str media gd yt">
+
+<!-- Convert $seconds to hours:min:sec format -->
+<xsl:template name="pretty-print-seconds">
+ <xsl:param name="seconds"/>
+
+ <xsl:variable name="sec" select="$seconds mod 60"/>
+ <xsl:variable name="min" select="floor($seconds div 60) mod 60"/>
+ <xsl:variable name="hour" select="floor($seconds div 3600)"/>
+
+ <xsl:value-of select="concat($hour, ':', format-number($min, '00'), ':', format-number($sec, '00'))"/>
+</xsl:template>
+
+<xsl:template match="/">
+<wvmenu>
+ <title><xsl:value-of select="/atom:entry/atom:title"/></title>
+ <textarea>
+ <label><xsl:value-of select="/atom:entry/media:group/media:description"/></label>
+ </textarea>
+
+ <textarea>
+ <label>Duration: <xsl:call-template name="pretty-print-seconds">
+ <xsl:with-param name="seconds">
+ <xsl:value-of select="/atom:entry/media:group/yt:duration/@seconds"/>
+ </xsl:with-param>
+ </xsl:call-template>
+ </label>
+ </textarea>
+
+ <textarea>
+ <label>Views: <xsl:value-of select="/atom:entry/yt:statistics/@viewCount"/></label>
+ </textarea>
+
+ <textarea>
+ <label>Rating: <xsl:value-of select="/atom:entry/gd:rating/@average"/></label>
+ </textarea>
+
+ <textarea>
+ <label>Published: <xsl:value-of select="str:replace(str:replace(/atom:entry/atom:published, '.000', ' '), 'T', ' ')"/></label>
+ </textarea>
+
+ <xsl:if test="/atom:entry/atom:link[@rel='http://gdata.youtube.com/schemas/2007#video.responses']">
+ <link>
+ <label>Video responses</label>
+ <ref>wvt:///www.youtube.com/navigation.xsl?srcurl=<xsl:value-of select="str:encode-uri(/atom:entry/atom:link[@rel='http://gdata.youtube.com/schemas/2007#video.responses']/@href, true())"/></ref>
+ </link>
+ </xsl:if>
+
+ <xsl:if test="/atom:entry/atom:link[@rel='http://gdata.youtube.com/schemas/2007#video.related']">
+ <link>
+ <label>Related videos</label>
+ <ref>wvt:///www.youtube.com/navigation.xsl?srcurl=<xsl:value-of select="str:encode-uri(/atom:entry/atom:link[@rel='http://gdata.youtube.com/schemas/2007#video.related']/@href, true())"/></ref>
+ </link>
+ </xsl:if>
+
+ <link>
+ <label>Download this video</label>
+ <stream>wvt:///www.youtube.com/video.xsl?srcurl=http://www.youtube.com/get_video_info?video_id=<xsl:value-of select="/atom:entry/media:group/yt:videoid"/></stream>
+ </link>
+
+</wvmenu>
+</xsl:template>
+
+</xsl:stylesheet>