audio.html 568 B

1234567891011121314
  1. <p>Audio File Preview</p>
  2. <audio id="audioplayer" src="{{preview_url}}" style="width: 100%" controls></audio>
  3. <textarea id="embeddedCode" class="u-full-width" style="height: 100px;"></textarea>
  4. <script>
  5. player=document.getElementById("audioplayer");
  6. player.volume=0.2;
  7. var port = window.location.port;
  8. if (port != ""){
  9. port = ":" + port;
  10. }
  11. $("#embeddedCode").text(`<audio id="audioplayer" src="${location.protocol}//${window.location.hostname}${port}{{preview_url}}{{filename}}" style="width: 400px" controls></audio>`);
  12. </script>