title: perform an action on "timeupdate" after certain time interval
body: <p>I am using html5 video and trying to store the amount of time video viewed by user for continuing the video from where it was closed.
  For this I am trying to  update the database  every 5 second video was viewed I did this to get  current time every 5 seconds:</p>
  
  <pre><code>$(document).ready(function()
  {
    $("video#eclassvideo").on(
      "timeupdate",
        function(e){
               performaction(this.currentTime, this.duration);
      });
  
  
  function performaction(currentTime, duration){
      setTimeout(function(){
          console.log(currentTime);
          console.log(' ajax action goes here')
      },5000)
  }
  </code></pre>
  
  <p>But this works only for first time it grabs after that it again continues to provide time 2-3 time per second. I tried using settimeout function during event firing but result was same. Please help me how do I get current time of video every 5 seconds only once.</p>
  
  <p>Thanks in advance. </p>