source: main/trunk/model-sites-dev/atea/collect/tiriana-audio/transform/pages/document.xsl@ 36197

Last change on this file since 36197 was 36197, checked in by davidb, 7 months ago

audio player improvements

File size: 5.8 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3 xmlns:java="http://xml.apache.org/xslt/java" xmlns:util="xalan://org.greenstone.gsdl3.util.XSLTUtil"
4 xmlns:gslib="http://www.greenstone.org/skinning"
5 xmlns:gsf="http://www.greenstone.org/greenstone3/schema/ConfigFormat" extension-element-prefixes="java util"
6 exclude-result-prefixes="java util gsf">
7
8 <!-- <xsl:template name="documentNodeAudio">
9 <div>
10 <audio id="audioPlayer" controls="controls">
11 <xsl:attribute name="src">
12 <xsl:value-of select="$httpPath"/>/index/assoc/<gsf:metadata name="assocfilepath" pos="1"/>/<gsf:metadata name="Source"/>
13 </xsl:attribute>
14 Your browser does not support the audio element.
15 </audio>
16 </div>
17 Download: <gsf:link type="source"><gsf:metadata name="Source"/></gsf:link>
18 </xsl:template> -->
19
20 <xsl:template name="documentNodeAudio">
21
22 <!-- <script type="text/javascript">
23 <xsl:text disable-output-escaping="yes">
24 $(document).ready(function() {
25 loadAudio('</xsl:text><xsl:value-of select="$httpPath"/>/index/assoc/<gsf:metadata name="assocfilepath" pos="1"/>/<gsf:metadata name="Source"/><xsl:text disable-output-escaping="yes">',
26 '</xsl:text>interfaces/{$interface_name}/images/Te_Kakano_C9B.csv<xsl:text disable-output-escaping="yes">');
27 })
28 </xsl:text>
29 </script> -->
30
31 <script type="text/javascript">
32 <xsl:text disable-output-escaping="yes">
33 $(document).ready(function() {
34 loadAudio('</xsl:text><xsl:value-of select="$httpPath"/>/index/assoc/<gsf:metadata name="assocfilepath" pos="1"/>/<gsf:metadata name="Source"/><xsl:text disable-output-escaping="yes">',
35 '</xsl:text><xsl:value-of select="$httpPath"/>/index/assoc/<gsf:metadata name="assocfilepath" pos="1"/>/speaker-diarization.csv<xsl:text disable-output-escaping="yes">');
36 })
37 </xsl:text>
38 </script>
39
40 <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"><xsl:text> </xsl:text></script>
41 <script type="text/javascript" src="https://unpkg.com/wavesurfer.js"><xsl:text> </xsl:text></script>
42 <script type="text/javascript" src="https://unpkg.com/wavesurfer.js/dist/plugin/wavesurfer.regions.min.js"><xsl:text> </xsl:text></script>
43 <script type="text/javascript" src="https://unpkg.com/wavesurfer.js/dist/plugin/wavesurfer.timeline.min.js"><xsl:text> </xsl:text></script>
44 <script type="text/javascript" src="https://unpkg.com/wavesurfer.js/dist/plugin/wavesurfer.cursor.min.js"><xsl:text> </xsl:text></script>
45 <script type="text/javascript" src="https://d3js.org/colorbrewer.v1.min.js"><xsl:text> </xsl:text></script>
46
47 <div id="audioContainer">
48 <div id="waveform"><text></text></div>
49 <div id="wave-timeline"><text></text></div>
50 <div id="toolbar">
51 <div class="flex-leftalign toolbar-section">
52 <img src="interfaces/{$interface_name}/images/bootstrap/zoom-out.svg" id="zoomIcon" class="noHover" />
53 <input type="range" min="1" max="100" value="25" id="slider" />
54 <img src="interfaces/{$interface_name}/images/bootstrap/zoom-in.svg" id="zoomIcon" class="noHover" />
55 </div>
56 <div class="flex-centeralign toolbar-section">
57 <img src="interfaces/{$interface_name}/images/bootstrap/back.svg" id="backButton" />
58 <img src="interfaces/{$interface_name}/images/bootstrap/play.svg" id="playPauseButton" />
59 <img src="interfaces/{$interface_name}/images/bootstrap/forward.svg" id="forwardButton" />
60 </div>
61 <div class="flex-rightalign toolbar-section">
62 <img src="interfaces/{$interface_name}/images/bootstrap/chapters.svg" id="chapterButton" />
63 <img src="interfaces/{$interface_name}/images/bootstrap/unmute.svg" id="muteButton" />
64 </div>
65 </div>
66 <div id="chapters"></div>
67 </div>
68 <!-- Download: <gsf:link type="source"><gsf:metadata name="Source"/></gsf:link> -->
69
70
71 </xsl:template>
72
73 <xsl:template name="documentNodeText">
74 <xsl:param name="force">0</xsl:param>
75 <!-- Hides the "This document has no text." message -->
76 <xsl:variable name="noText"><gsf:metadata name="NoText"/></xsl:variable>
77 <xsl:choose>
78 <xsl:when test="$force = '1' or not($noText = '1')">
79
80 <!-- Section text -->
81 <xsl:for-each select="nodeContent">
82 <xsl:call-template name="displayMarkedUpTextAndAnnotations"/>
83 </xsl:for-each>
84 </xsl:when>
85 <xsl:when test="$noText = '1' and not(metadataList/metadata[@name='ImageType'])">
86 <xsl:call-template name="documentNodeAudio"/>
87 </xsl:when>
88 </xsl:choose>
89 <xsl:text> </xsl:text>
90 </xsl:template>
91
92 <xsl:template name="documentHeading">
93 <span style="font-weight:bold; font-size: 120%;">
94 <xsl:call-template name="choose-title" />
95 </span>
96 <table id="tapeDetails">
97 <gsf:switch>
98 <gsf:metadata name='Notes' />
99 <gsf:when test='exists'>
100 <tr><td id="fCol">Notes:</td><td><gsf:metadata name="Notes" highlight="highlight" /></td></tr>
101 </gsf:when>
102 </gsf:switch>
103 <gsf:switch>
104 <gsf:metadata name='TapeLabel' />
105 <gsf:when test='exists'>
106 <tr><td id="fCol">Tape Label:</td><td><gsf:metadata name="TapeLabel" highlight="highlight" /></td></tr>
107 </gsf:when>
108 </gsf:switch>
109 <gsf:switch>
110 <gsf:metadata name='CardNotes' />
111 <gsf:when test='exists'>
112 <tr><td id="fCol">Card Notes:</td><td><gsf:metadata name="CardNotes" highlight="highlight" /></td></tr>
113 </gsf:when>
114 </gsf:switch>
115 <gsf:switch>
116 <gsf:metadata name='IsMicroCassette' />
117 <gsf:when test='equals' test-value='y'>
118 <tr><td id="fCol">Microcassette?</td><td>Yes</td></tr>
119 </gsf:when>
120 </gsf:switch>
121 </table>
122
123 <gsf:variable name="audioSource"><gsf:metadata name="Source"/></gsf:variable>
124 <!-- <audio controls src="Coronation_A.wav" type="audio/wav">
125 Your browser does not support the audio element.
126 </audio> -->
127
128 </xsl:template>
129
130</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.