Skip to content

Commit be8640e

Browse files
committed
update allTracks page
ignore audio_fies
1 parent 96aa064 commit be8640e

3 files changed

Lines changed: 39 additions & 3 deletions

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@
55
build
66

77
target
8+
9+
audio_files/*

audio_files/amen_beasty.wav

1.27 MB
Binary file not shown.

src/main/resources/templates/allTracks.html

Lines changed: 37 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,52 @@ <h2 th:text="${message}"/>
1616
</form>
1717
</div>
1818

19+
1920
<div>
21+
<a1>All uploaded Tracks:</a1>
2022
<ul>
23+
<!-- <li th:each="file : ${files}"> -->
24+
<!-- <a th:href="@{|/track/${file}|}" th:text="${file}">Download Link</a>
25+
<br>
26+
<audio controls>
27+
<source th:src="@{|/track/${file}|}" type="audio/mpeg" />
28+
Your browser does not support the audio element.
29+
</audio> -->
30+
31+
32+
2133
<li th:each="file : ${files}">
2234
<a th:href="@{|/track/${file}|}" th:text="@{|/track/${file}|}" />
2335
<br>
24-
<audio th:src="@{|/download/${file}|}" controls="controls">
25-
<source th:src="@{|/download/${file}|}" type="audio/mpeg" />
36+
<!-- <audio th:src="@{|/download/${file}|}" controls="controls">
37+
s<source th:src="@{|/download/${file}|}" type="audio/mpeg" />
2638
Your browser does not support the audio element.
27-
</audio>
39+
</audio> -->
40+
41+
42+
2843
</li>
2944
</ul>
3045
</div>
3146

47+
<!--
48+
<script th:inline="javascript">
49+
/*<![CDATA[*/
50+
// This script will load the audio file when the play button is pressed
51+
document.querySelectorAll('audio').forEach(function(audio) {
52+
var source = audio.querySelector('source');
53+
audio.addEventListener('play', function(e) {
54+
if (!source.src) {
55+
// Use the th:src attribute value as the source URL
56+
source.src = source.getAttribute('th:src');
57+
audio.load();
58+
}
59+
});
60+
});
61+
/*]]>*/
62+
</script> -->
63+
64+
3265
</body>
3366
</html>
67+

0 commit comments

Comments
 (0)