title: Playing an FLV video with a fallback on HTML5
body: <p>I told my boss to use HTML5 with a fallback on FLASH.</p>
  
  <p>But he said he wants FLASH as the first option, and if the browser (ipad or any other) can't  recognize the FLASH , it should play the MP4 file we got. </p>
  
  <p>I suggested HTML5 with fallback on Flash. But he wants the opposite.</p>
  
  <p>How can I get that done ? Do you guys have sample code ?</p>
  
  <p><strong>Solution</strong>
  Using SWFObject (google it) and a SWF Controller (like FlashMediaPlayback.swf).
  It's  very important to understand that the iPad has limitations with video size. 
  So the MP4 file can't be bigger than 720p and 160kbps for audio.</p>
  
  <p>I'll post my code right below. You can make it yours and use it your own way.</p>
  
  <pre><code>&lt;div style="text-align:center" &gt;
  &lt;script type="text/javascript" src="swfobject.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript"&gt;
      var flashvars = {};
      flashvars.src = "demo.flv";
      flashvars.controlBarMode = "floating";
      flashvars.autostart="true";
      var params = {};
      params.allowfullscreen = "true";
      params.allowscriptaccess = "always";
      params.bgcolor = "#1a1a1a";
      params.scale = "showall";
      var attributes = {};
      swfobject.embedSWF("demo_controller.swf", "videoDiv", "920", "560", "10.1.0", "expressInstall.swf", flashvars, params, attributes);
  &lt;/script&gt;
  
  &lt;div id="videoDiv" style="text-align:center"&gt;
  &lt;video controls="controls" width="720" height="480"&gt;
  &lt;source src="demo.mp4" type="video/mp4"/&gt;
  &lt;source src="demo.ogv" type="video/ogg"/&gt;
  &lt;/video&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>