title: Is it possible to include a video link in array? if yes, how so?
body: <p>I've been trying to make a video playlist, basically, when one of them stops ends, the other one starts, when that ends, the original one starts. 1>2>1>2 etc repeatedly. I have attempted to do this by including the video links in an array however they don't show up at all. I only wish to use javascript for this.  My code:</p>
  
  <p><strong></strong></p>
  
  <pre><code>&lt;body onload="setFirstVideo()"&gt;
  &lt;video controls  onended="videoEnded()"
         src=""&gt;
  &lt;/video&gt;
  </code></pre>
  
  <p><strong></strong></p>
  
  <pre><code>var videoSources = new Array();
  
  videoSources[0] = ['&lt;video&gt; &lt;source src="http://courses.cs.cityu.edu.hk/cs2204/barbecue.mp4"&gt;,&lt;source src="http://courses.cs.cityu.edu.hk/cs2204/barbecue.ogg"&gt; &lt;/video&gt;'];
  videoSources[1] = [  "http://courses.cs.cityu.edu.hk/cs2204/cakemaking-s.mp4", "http://courses.cs.cityu.edu.hk/cs2204/cakemaking-s.ogg"];
  var currentIndex = 0;
  
  function setFirstVideo()
  {
      var myVideo = document.getElementsByTagName('video')[0];
          myVideo.src = videoSources[currentIndex];
  }
  
  function videoEnded(){
      var myVideo = document.getElementsByTagName('video')[0];
      currentIndex = (currentIndex+1) % videoSources.length;
      myVideo.src = videoSources[currentIndex];
      myVideo.load();
      myVideo.play();
  }
  </code></pre>