Browse Source

messed around

master
alicestrt 4 years ago
parent
commit
47e6a4fd37
  1. 13
      templates/hello.html

13
templates/hello.html

@ -25,7 +25,7 @@
</div> </div>
</div> </div>
<div class="col-md-9"> <div class="col-md-9">
<audio controls> <audio id="audio-1" controls onclick="Start()">
<source src="../static/audio/myths.mp3" type="audio/mpeg"> <source src="../static/audio/myths.mp3" type="audio/mpeg">
Your browser does not support the audio tag. Your browser does not support the audio tag.
</audio> </audio>
@ -90,6 +90,17 @@
var elem = document.getElementById("ele"); var elem = document.getElementById("ele");
elem.scrollIntoView(); elem.scrollIntoView();
} }
var soundToPlay = document.getElementById('audio-1');
function Start(){
randomStartingTime = Random.Range(0.0, 3099.0);
PlaySound();
}
function PlaySound(){
soundToPlay.time = randomStartingTime;
soundToPlay.Play();
}
</script> </script>

Loading…
Cancel
Save