title: JavaScript addEventListener pause and play video
body: <p>I have a video in my html. I would like the video to pause at 5 seconds after playing so I used addEventListener. I also have 2 buttons that call either restart() or jump(). </p>
  
  <p>When I play my video, an EventListener is called on my video. It pauses at 5 seconds, but I can't get it to play after 5 seconds (I've tried removing the listener but then the video no longer pauses). When I call jump(), it'll take me to 10 seconds but continue to pause when I try to play it. When I call reset(), the video will play up to 5 seconds again, which makes sense since I have a Listener on it. How do I get it to play after 10 seconds for when I call jump()? At first I thought I would have to remove my Listener but I believe I'll need that still because I would like the video to pause at 15 seconds. Or maybe I need to call removeEventListener somewhere else?</p>
  
  <p>js</p>
  
  <pre><code>var video = document.getElementById("myvid");
  video.addEventListener("timeupdate", function(){
  if(this.currentTime &gt;= 5) {
      this.pause();       
  }
  });
  
  
  function restart(){
      video.currentTime = 0;
  }
  
  function jump(){ 
      video.currentTime = 10; 
      if (video.currentTime &gt;=15){
         video.pause
      }
  }
  </code></pre>
  
  <p>html</p>
  
  <pre><code>&lt;video id="myvid" width="320" height="240" controls&gt;
      &lt;source src="video.mp4" type="video/mp4"&gt;
  &lt;/video&gt;
  
  &lt;button onclick="restart()"&gt;restart&lt;/button&gt;
  &lt;button onclick="jump()"&gt;jump&lt;/button&gt;
  </code></pre>