title: Seekable html5 audio Uncaught Error: IndexSizeError: DOM Exception 1
body: <p>I was having an issue trying to use the HTML5  API (also with SoundManager2). When trying to find the duration of a song so that I could make a progress bar as the song was playing. I kept running into the following error in the console:</p>
  
  <pre><code>Uncaught Error: IndexSizeError: DOM Exception 1
  </code></pre>
  
  <p>Here's the code used get the progress:</p>
  
  <pre><code>&lt;a href="/uploads/song_71.mp3" class="song" id="song_71"&gt;&lt;/a&gt;
  &lt;audio id="song" preload="auto" src=""&gt;&lt;/audio&gt;
  
  &lt;script&gt;
  
    var song = document.getElementById("song");
    song.addEventListener("timeupdate", function(){
      var end = this.seekable.end(0),
          curr = this.currentTime,
          prog = (curr / end) * 100;
  
      console.log(this.currentTime, this.duration)
    })
  
    song.play()
  
    document.getElementById("play_song").addEventListener("click", function(e){    
      var song_file = this.href;
      song.src = song_file
      song.play()
  
      if(e){ e.preventDefault(); }
      return false;
    })
  
  &lt;/script&gt;
  </code></pre>