title: Playing videos one after another in html5
body: <p>I am playing videos one after another in following code,</p>
  
  <pre><code>&lt;html&gt;
  &lt;body&gt;
      &lt;video src="videos/video1.mp4" id="myVideo" autoplay&gt;
          video not supported
      &lt;/video&gt;
  &lt;/body&gt;
      &lt;script type='text/javascript'&gt;
          var count=1;
      var player=document.getElementById('myVideo');
      player.addEventListener('ended',myHandler,false);
  
      function myHandler(e) {
          if(!e) 
          { e = window.event; }
          count++;
          player.src="videos/video"+count+".mp4";
          }
  &lt;/script&gt;
  </code></pre>
  
  <p></p>
  
  <p>Now, my question is, There are many video files having different name (in remote directory) which is on server and 
  I don't know name of all files. So how to make their queue and play one after another using JavaScript??</p>