Merge podlove simple-chapters

This commit is contained in:
Astro 2012-06-27 04:06:14 +02:00
commit 7eedd31d9d
9 changed files with 107 additions and 36 deletions

View File

@ -16,32 +16,6 @@
<p>
Ich bedanke mich bei allen Engeln die mir Rede und Antwort standen oder Gespräche zu Stande gebracht haben. Da die Interviews teilweise länglich sind, habe ich eine <link href="http://ftp.c3d2.de/pentacast/pentacast-43-28c3.cue">CUE-Datei fertig gemacht</link>, mit der ihr das MP3 in mundgerechte Happen zerteilen könnt. In den Shownotes findet ihr eine Übersicht, wer ungefähr wann redet und in welcher Sprache.
</p>
<p>Shownotes:</p>
<ul>
<li><link href="#">0:00 Intro, koeart, DE</link></li>
<li><link href="#">8:03 Engelsystem, msquare, DE</link></li>
<li><link href="https://www.engelsystem.de/">Engelsystem</link></li>
<li><link href="#">12:17 FEM, ??, DE</link></li>
<li><link href="http://www.fem.tu-ilmenau.de/">FEM TU Ilmenau</link></li>
<li><link href="https://secure.wikimedia.org/wikipedia/en/wiki/HTTP_Live_Streaming">WP: HTTP Live Streaming</link></li>
<li><link href="#">36:24 Masken tiefziehen, Aram Bartholl, DE</link></li>
<li><link href="http://datenform.de/indexeng.html">Aram Bartholl</link></li>
<li><link href="http://cre.fm/cre181">CRE181: Aram Bartholl</link></li>
<li><link href="#">43:07 Strom, friedrich, DE</link></li>
<li><link href="#">48:34 CERT, vt, DE</link></li>
<li><link href="#">54:56 Herold Angel, Nick Farr, EN</link></li>
<li><link href="http://events.ccc.de/congress/2011/wiki/No_nerd_left_behind">28c3: No Nerd Left Behind</link></li>
<li><link href="#">64:12 ERFA's, Maha, DE</link></li>
<li><link href="http://ccc.de/de/regional">CCC Regional</link></li>
<li><link href="#">79:19 Pressearbeit, Constanze Kurz, DE</link></li>
<li><link href="#">97:31 Eventphone, sascha, DE</link></li>
<li><link href="http://eventphone.de/">Eventphone</link></li>
<li><link href="#">108:33 Foodangel, simon, DE</link></li>
<li><link href="#">111:00 Chefangel, Frantisek Apfelbeck, EN</link></li>
<li><link href="http://www.frantisekapfelbeck.org/wiki/index.php?title=Food_Hacking_Base">Frantisek Apfelbeck, Foodhacking</link></li>
<li><link href="#">123:10 Nick Farr Lullaby (Machine Lullaby by Fear of Ghosts Remix)</link></li>
<li><link href="http://events.ccc.de/congress/2011/wiki/Documentation">28c3 Recordings</link></li>
</ul>
</addendum>
<resource title="pentacast 43: 28c3" size="123801299"
@ -49,5 +23,28 @@
url="http://ftp.c3d2.de/pentacast/pentacast-43-28c3.ogg">
<alternative size="178215243" type="audio/mpeg"
url="http://ftp.c3d2.de/pentacast/pentacast-43-28c3.mp3"/>
<chapters xmlns="http://podlove.de/simple-chapters">
<chapter start="0:00" title="Intro, koeart" xml:lang="de"/>
<chapter start="8:03" title="Engelsystem, msquare" xml:lang="de" href="https://www.engelsystem.de/"/>
<chapter start="12:17" title="FEM, TU Ilmenau" xml:lang="de" href="http://www.fem.tu-ilmenau.de/"/>
<chapter href="https://secure.wikimedia.org/wikipedia/en/wiki/HTTP_Live_Streaming" title="WP: HTTP Live Streaming"/>
<chapter start="36:24" title="Masken tiefziehen, Aram Bartholl" xml:lang="de"/>
<chapter href="http://datenform.de/indexeng.html" title="Aram Bartholl"/>
<chapter href="http://cre.fm/cre181" title="CRE181: Aram Bartholl"/>
<chapter start="43:07" title="Strom, friedrich" xml:lang="de"/>
<chapter start="48:34" title="CERT, vt" xml:lang="de"/>
<chapter start="54:56" title="Herold Angel, Nick Farr" xml:lang="en"/>
<chapter href="http://events.ccc.de/congress/2011/wiki/No_nerd_left_behind" title="28c3: No Nerd Left Behind"/>
<chapter start="64:12" title="ERFAs, Maha" xml:lang="de"/>
<chapter href="http://ccc.de/de/regional" title="CCC Regional"/>
<chapter start="79:19" title="Pressearbeit, Constanze Kurz" xml:lang="de"/>
<chapter start="97:31" title="Eventphone, sascha" xml:lang="de"/>
<chapter href="http://eventphone.de/" title="Eventphone"/>
<chapter start="108:33" title="Foodangel, simon" xml:lang="de"/>
<chapter start="111:00" title="Chefangel, Frantisek Apfelbeck" xml:lang="en"/>
<chapter href="http://www.frantisekapfelbeck.org/wiki/index.php?title=Food_Hacking_Base" title="Frantisek Apfelbeck, Foodhacking"/>
<chapter start="123:10" title="Nick Farr Lullaby (Machine Lullaby by Fear of Ghosts Remix)"/>
<chapter href="http://events.ccc.de/congress/2011/wiki/Documentation" title="28c3 Recordings"/>
</chapters>
</resource>
</item>

View File

@ -31,7 +31,7 @@ function arrayForEach(array, iter) {
}
}
function addButton(container, res) {
function addButton(container, res, chapters) {
var button = $('<a class="play" title="Abspielen"><span class="postercaption">▶ Play</span></a>');
if (res.poster) {
var img = $('<img class="poster"/>');
@ -54,7 +54,7 @@ function addButton(container, res) {
button.click(function() {
button.remove();
addPlayer(container, res);
addPlayer(container, res, chapters);
var section = container.parents().
filter(function() {
@ -66,7 +66,16 @@ function addButton(container, res) {
container.append(button);
}
function addPlayer(container, res) {
function parseTime(time) {
var parts = time.split(":"), part;
var r = 0;
while((part = parts.shift())) {
r = r * 60 + parseInt(part);
}
return r;
}
function addPlayer(container, res, chapters) {
var types = arrayMap(res, function(res) {
return res.type;
});
@ -127,6 +136,30 @@ function addPlayer(container, res) {
if (fallback)
html5player.append(fallback);
container.append(html5player);
if (chapters[0]) {
var dl = $('<dl class="chapters"></dl>');
var prevStart;
chapters.find('chapter').each(function() {
var title = this.getAttribute('title');
var start = this.getAttribute('start');
var href = this.getAttribute('href');
if (start && start != prevStart) {
var dt = $('<dt><a href="#"></a></dt>');
var dt_a = dt.find('a');
dt_a.text(start);
dt_a.click(function(ev) {
ev.preventDefault();
html5player[0].currentTime = parseTime(start);
});
dl.append(dt);
}
prevStart = start;
var dd = $('<dd></dd>');
dd.text(title);
dl.append(dd);
});
container.append(dl);
}
} else if (fallback) {
container.append(fallback);
} else {
@ -164,7 +197,7 @@ $(document).ready(function() {
}), canPlay)) {
var liEl = $('<li class="play-resource"></li>');
$(this).before(liEl);
var player = addButton(liEl, res);
var player = addButton(liEl, res, $(this).find('chapters'));
}
});
} catch (x) {

View File

@ -723,6 +723,26 @@ li audio, li video, li .poster {
color: #333;
}
.chapters {
margin: 0.5em auto;
}
.chapters dt, .chapters dd {
line-height: 2em;
margin: 0;
padding: 0;
}
.chapters dt {
width: 8em;
text-align: right;
margin-bottom: -2em;
}
.chapters dt:after {
content: '';
}
.chapters dd {
margin-left: 10em;
}
p.blockquote {
padding: .5em .5em .5em 2em;
border-left: 20px solid #eee;

View File

@ -2,10 +2,9 @@
<!--
-*- rnc -*-
RELAX NG Compact Syntax Grammar for the
Atom Format Specification
draft-ietf-atompub-format-10
Atom Format Specification Version 11
-->
<grammar xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:s="http://www.ascc.net/xml/schematron" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
<grammar ns="http://www.w3.org/1999/xhtml" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:s="http://www.ascc.net/xml/schematron" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
<start>
<choice>
<ref name="atomFeed"/>
@ -354,9 +353,9 @@
<element name="atom:source">
<ref name="atomCommonAttributes"/>
<interleave>
<optional>
<zeroOrMore>
<ref name="atomAuthor"/>
</optional>
</zeroOrMore>
<zeroOrMore>
<ref name="atomCategory"/>
</zeroOrMore>
@ -570,7 +569,7 @@
<!-- XHTML -->
<define name="anyXHTML">
<element>
<nsName ns="http://www.w3.org/1999/xhtml"/>
<nsName/>
<zeroOrMore>
<choice>
<attribute>

View File

@ -57,6 +57,8 @@
<xs:sequence>
<xs:element ref="alternative" minOccurs="0"
maxOccurs="unbounded"/>
<xs:any namespace="http://podlove.de/simple-chapters"
processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="size" type="xs:nonNegativeInteger"
use="required"/>

View File

@ -89,6 +89,9 @@
href="{$resource_href}"
type="{@type}"
length="{@size}" />
<xsl:copy-of select="sc:chapters"
xmlns:sc="http://podlove.de/simple-chapters"/>
</xsl:for-each>
<xsl:variable name="flattr_link">

View File

@ -384,6 +384,14 @@
</xsl:call-template>, <xsl:call-template name="format-filesize">
<xsl:with-param name="value" select="@size"/>
</xsl:call-template>)
<xsl:if test="$baseurl = '' or $baseurl = '../'">
<!-- Include chapters only in XHTML for JS player. ATOM feeds
copy chapters outside <content type="xhtml"/>
-->
<xsl:copy-of select="sc:chapters"
xmlns:sc="http://podlove.de/simple-chapters"/>
</xsl:if>
</li>
</xsl:template>

View File

@ -238,6 +238,8 @@
<xsl:with-param name="resource_url" select="$href"/>
<xsl:with-param name="resource_size" select="@size"/>
<xsl:with-param name="resource_type" select="@type"/>
<xsl:with-param name="chapters" select="sc:chapters"
xmlns:sc="http://podlove.de/simple-chapters"/>
</xsl:call-template>
</xsl:template>
@ -249,6 +251,7 @@
<xsl:param name="resource_url"/>
<xsl:param name="resource_size"/>
<xsl:param name="resource_type"/>
<xsl:param name="chapters"/>
<item>
<xsl:variable name="href">
@ -302,6 +305,8 @@
<xsl:if test="string-length($flattr_link) &gt; 0">
<atom:link rel="payment" href="{$flattr_link}" type="text/html"/>
</xsl:if>
<xsl:copy-of select="$chapters"/>
</item>
</xsl:template>

View File

@ -122,6 +122,10 @@
<xsl:if test="string-length($flattr_link) &gt; 0">
<atom:link rel="payment" href="{$flattr_link}" type="text/html"/>
</xsl:if>
<xsl:copy-of select="resource/sc:chapters"
xmlns:sc="http://podlove.de/simple-chapters"/>
</item>
</xsl:template>