|
|
| (One intermediate revision by the same user not shown) |
| Line 1: |
Line 1: |
| <includeonly> | | <includeonly><div class="audioplayer" data-filename="{{{1}}}" data-caption="{{{2|Audio File}}}"></div></includeonly> |
| <div id="audioplayer-{{{id|1}}}"></div> | |
| <script>
| |
| (function() {
| |
| var container = document.getElementById("audioplayer-{{{id|1}}}");
| |
| if (!container) return;
| |
| var audio = document.createElement("audio");
| |
| audio.setAttribute("controls", "");
| |
| audio.setAttribute("preload", "metadata");
| |
| audio.style.maxWidth = "240px";
| |
| | |
| var src = document.createElement("source");
| |
| src.src = "{{{url}}}";
| |
| src.type = "audio/ogg";
| |
| | |
| audio.appendChild(src);
| |
| container.appendChild(audio);
| |
| })();
| |
| </script> | |
| </includeonly> | |