title: PHP media streaming on Android
body: <p>The idea is to stream a video through PHP.</p>
  
  <p>I created a PHP script and uploaded it to my free website. Then I embedded the video with the source path where I pass the values to it.</p>
  
  <p>When I try it on my PC's browser it works fine. But when I try it on a WebView on Android it wont even show up.</p>
  
  <p>Any help?</p>
  
  <p><strong>streamer.php</strong></p>
  
  <pre><code>&lt;?php
  $file = './' . $_GET["file"];
  
  $pos = (isset($_GET["pos"])) ? intval($_GET["pos"]): 0;
  
  header("Content-Type: video/x-flv"); 
  header('Content-Length: ' . filesize($file));
  
  if($pos &gt; 0) {
      print("FLV"); 
      print(pack('C',1));
      print(pack('C',1));
      print(pack('N',9));
      print(pack('N',9));
  }
  
  $fh = fopen($file,"rb");
  fseek($fh, $pos);
  fpassthru($fh);
  fclose($fh);
  
  ?&gt;
  </code></pre>
  
  <p><strong>Embed code</strong></p>
  
  <pre><code>&lt;embed src="http://mywebsite.com/streamer.php?file=video.flv" /&gt;
  </code></pre>
  
  <p><strong>Tried also in HTML5 and in another video format</strong></p>
  
  <pre><code>&lt;video id="vid"&gt;
     &lt;source src="http://chris-mmt.site40.net/streamer.php?file=video.mp4" type="video/mp4"&gt;
  &lt;/video&gt;
  </code></pre>