title: Javasciript custom video player current time / total time
body: <p>I'm making a html5 video player and am using javascript to update the current time out of the total time. So far my script is </p>
  
  <pre><code>function updateTime() {
      var curTime = mediaPlayer.currentTime;
      var totTime = mediaPlayer.duration;
      timePlayed.innerHTML = curTime + '/' + totTime;
  }
  </code></pre>
  
  <p>I have an eventlistener at the start. So the script works, but it outputs it like <code>23.703/285.067513</code> How would I get it to output something like 00:00 / 00:00 Just like the youtube video player, so it would be like minute minute:second second / minute minute:second second. For my html, I just have a span <code>&lt;span id="timePlayed"&gt;00:00/00:00&lt;/span&gt;</code> 
  If anyone can help me with this, thanks in advance!</p>