title: insert ads on HTML5 video
body: <p>How can I insert ads on html5 video tag before the main video plays? Is there any open source tools to make this easier? Is there any reference that can guide me there?</p>
  
  <p>It is working with this code:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
     // listener function changes src
     function myNewSrc() {
        var myVideo = document.getElementsByTagName('video')[0];
        myVideo.src="../main.webm";
        myVideo.load();
        myVideo.play();
      }
  
     // function adds listener function to ended event --&gt;
  
      function myAddListener(){
       var myVideo = document.getElementsByTagName('video')[0];
       myVideo.addEventListener('ended',myNewSrc,false);
      }
  &lt;/script&gt;
  </code></pre>
  
  <p>but I can't when it play the second one. It shows the poster. How do I get rid of the poster?</p>