title: Play/Pause iFrame using Javascript?
body: <p>Is there a way to play or pause an iFrame video? It is not a youtube or vimeo video, so there is no api for me to reference. </p>
  
  <p>For some background, I am pulling this video from an api that only returns their videos as flash objects. Since flash doesn't seem to play on any mobile devices, I had to pull a src attribute and dynamically put it into an iframe. This seems to be working fine, but I need a way to auto play the video when the page loads. My best guess is to call a JS function when the document loads, but Im not sure how to make the thing play.</p>
  
  <p>Here is a video in object format:</p>
  
  <pre><code>&lt;object height="344" width="434"&gt;
      &lt;param name="allowfullscreen" value="true"&gt;
      &lt;param name="AllowScriptAccess" value="always"&gt;
      &lt;param name="movie" value="http://embed.redtube.com/player/?id=260891&amp;style=redtube"&gt;
      &lt;param name="FlashVars" value="id=260891&amp;style=redtube&amp;autostart=true"&gt;
      &lt;embed src="http://embed.redtube.com/player/?id=260891&amp;style=redtube" 
          allowfullscreen="true" 
          AllowScriptAccess="always" 
          flashvars="autostart=true" 
          pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" 
          type="application/x-shockwave-flash" 
          height="344" width="434" /&gt;
  &lt;/object&gt;
  </code></pre>
  
  <p>This flash video does not play on a mobile device though.
  I can pull the src attribute above in php, and plug it into an iframe like below, which should play on any device. </p>
  
  <pre><code>&lt;iframe id="myMovie" src=&lt;?php echo $src;?&gt; width="750" height="420" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen &gt;&lt;/iframe&gt;
  </code></pre>
  
  <p>This works fine and the video shows up and plays on my local machine, but will not auto play, which is the desired functionality.</p>
  
  <p>So if there is a better way to achieve the desired functionality on all devices please let me know. If anyone can help me auto play the iframe, it would be very much appreciated.</p>