@jonathanbell/Link to a certain moment in an audio file with JavaScript
HTML, CSS, JS

Create links that onclick take a user to a certain point in an audio file.

fork
loading
Files
  • index.html
  • index.js
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width">
    <title>Link to a certain point in an audio file with JS</title>
  </head>
  <body>
    <audio id="audio1" controls preload>
      <source src="https://30.jonathanbell.ca/wp-content/uploads/grouch-simpleman.mp3" type="audio/mpeg">
      <source src="https://30.jonathanbell.ca/wp-content/uploads/grouch-simpleman.ogg" type="audio/ogg">
    </audio>
    <script src="index.js"></script>
  </body>
</html>
result
console