HTML5 audio element - seek slider - Failed to set the 'currentTime' property on 'HTMLMediaElement': The provided double value is non-finite
<p>This is my first question on Stack Overflow; apologies if I have done it wrong.</p>

<p>I am attempting to use the Web Audio API to create a nice little audio player for myself. However, I have run into a problem in trying to create a "seek" function for a user to skip around in the song.</p>

<p>HTML:</p>

<pre><code>&lt;p&gt;Seek Slider&lt;/p&gt;
&lt;input id="seekslider" type="range" min="0" max="100" value="0" /&gt;
</code></pre>

<p>JavaScript:</p>

<pre><code>var seekslider = $('#seekslider');

$(seekslider).mousedown(function(e) {
  seeking = true;
  seek(e);
});

$(seekslider).mousemove(function(e) {
  seek(e);
});

$(seekslider).mouseup(function(e) {
  seeking = false;
});

function seek(e) {
  if (seeking) {
    seekslider.value = e.clientX - seekslider.offsetLeft;
    console.log(typeof(seekslider.value));
    console.log(seekslider.value, audio.currentTime);
    seekto = audio.duration * (seekslider.value / 100);
    console.log(seekto);
    audio.currentTime = seekto;
  }
}     
</code></pre>

<p>The error:</p>

<blockquote>
  <p>Failed to set the 'currentTime' property on 'HTMLMediaElement': The provided double value is non-finite.</p>
</blockquote>

<p>Now, <code>console.log(typeof(seekslider.value))</code> returns a number.
however, <code>console.log(seekslider.value)</code> returns <code>NaN</code>.</p>

<p>I understand the value of <code>currentTime</code> is a float with a decimal point.</p>

<p>I have attempted:</p>

<pre><code>parseFloat(e.clientX - seekslider.offsetLeft);
</code></pre>

<p>In addition to numerous other attempts at solving this using <code>parseFloat</code>.</p>

<p>I am just a bit confused.  I sincerely appreciate any help y'all have to offer.  Good day folks.</p>