title: HTML5 audio player shows time 0:00/NaN:NaN
body: <p>I'm trying to customize html5 audio player here and can't figure out what is wrong with duration. It shows NaN after adding duration, minutes and seconds in js file. Buttons are working fine already and audio is playing too.</p>
  
  <p>JS:</p>
  
  <pre><code>var mytrack = document.getElementById('mytrack');
  var playButton = document.getElementById('playButton');
  var muteButton = document.getElementById('muteButton');
  
  var duration = document.getElementById('fullDuration');
  var currentTime = document.getElementById('currentTime');
  
  var minutes = parseInt(mytrack.duration/60);
  var seconds = parseInt(mytrack.duration%60);
  
  duration.innerHTML = minutes + ':'+ seconds;
  
  function playOrPause(){
      if(!mytrack.paused &amp;&amp; !mytrack.ended){
          mytrack.pause();
          playButton.style.backgroundImage = 'url(images/play.png)';
      }
      else{
          mytrack.play();
          playButton.style.backgroundImage = 'url(images/pause.png)';
      }
  }
  
  function muteOrUnmute() {
      if(mytrack.muted == true){
          mytrack.muted = false;
          muteButton.style.backgroundImage = 'url(images/mute.png)';
      }
      else{
          mytrack.muted = true;
          muteButton.style.backgroundImage = 'url(images/muted.png)';
      }
  }
  </code></pre>
  
  <p>HTML:</p>
  
  <pre><code>&lt;div id="wrap"&gt;
      &lt;audio id="mytrack" preload=meta&gt;
          &lt;source src="audio/song.wav" type="audio/wav"&gt;
      &lt;/audio&gt;
      &lt;nav&gt;
          &lt;div id="defaultBar"&gt;
              &lt;div id="progressBar"&gt;&lt;/div&gt;
          &lt;/div&gt;
          &lt;div id="buttons"&gt;
              &lt;button type="button" id="playButton"&gt;&lt;/button&gt;
              &lt;button type="button" id="muteButton"&gt;&lt;/button&gt;
              &lt;span id="currentTime"&gt;0:00&lt;/span&gt;/&lt;span id="fullDuration"&gt;0:00&lt;/span&gt;
          &lt;/div&gt;
      &lt;/nav&gt;
  &lt;/div&gt;
  </code></pre>