title: restrict html5 video display per session?
body: <p>I want to restrict video and photo displays per session. For example, visitor watches 3 videos and when he tries to watch a fourth video he's redirected to a subscription page. I'll be using JWPlayer or native HTML5, doesn't matter, and this would work in WP, but looking to any way to do it with PHP (I'm not an expert by any mean).</p>
  
  <p>So, ideally, this would be teh workflow:
      1)visitor watches video1 --> optional message --> you have 2 videos left
      2)visitor watches video2 --> optional message --> you have 1 videos left
      3)visitor watches video3 --> optional message --> you have 0 videos left
      4)visitor tries to watch video4 --> redirect</p>
  
  <p>So far I found ways to limit per bandwidth or per time (only 1 video and then redirect), but I need to serve exactly 3 videos, no matter the time or size, so those solutions won't work. Any idea on how to achieve this? </p>
  
  <p>edit: here's some code to redirect, I really didn't add anything yet because nothing is what I need, but take a look:</p>
  
  <pre><code>&lt;script src="text/javascript"&gt;
  function vidplay(){
      var video = document.getElementById('video');
      video.play();
      video.addEventListener('ended',function(){
          window.location = 'http://SUBSCRIBE_PAGE';
      });
  }
  &lt;/script&gt;
  &lt;video controls id="video" width="640" height="360" onclick="vidplay()"&gt;
      &lt;source src="video/video.mp4" type="video/mp4" /&gt;
  &lt;/video&gt;
  </code></pre>