File tree Expand file tree Collapse file tree
src/main/resources/templates Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55build
66
77target
8+
9+ audio_files /*
Original file line number Diff line number Diff 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+
You can’t perform that action at this time.
0 commit comments