Add new audio, add some variables master
authorCameron Ball <cameron@moodle.com>
Wed, 16 Dec 2020 12:03:26 +0000 (20:03 +0800)
committerCameron Ball <cameron@moodle.com>
Wed, 16 Dec 2020 12:03:26 +0000 (20:03 +0800)
audio/3.webm [new file with mode: 0644]
index.html

diff --git a/audio/3.webm b/audio/3.webm
new file mode 100644 (file)
index 0000000..f4b188c
Binary files /dev/null and b/audio/3.webm differ
index f982db7..3ac4c18 100644 (file)
     <script>
      var timerElement = document.getElementById("timer");
      var units = ['weeks', 'days', 'hours', 'minutes', 'seconds', 'milliseconds'];
+     var numAudio  = 3;
+     var numVideo = 5;
      var delay = 20;
 
      var vidElement = document.getElementById('video');
-     var activeVideo = Math.floor((Math.random() * 5) + 1);
+     var activeVideo = Math.floor((Math.random() * numVideo) + 1);
      vidElement.src = "video/" + activeVideo + ".mp4";
 
      var audioElement = document.getElementById('audio');
-     var activeAudio = Math.floor((Math.random() * 2) + 1);
+     var activeAudio = Math.floor((Math.random() * numAudio) + 1);
      audioElement.src = "audio/" + activeAudio + ".webm";
 
      function toggleAudio() {