1

The idea is to stream a video through PHP.

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.

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.

Any help?

streamer.php

<?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 > 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);

?>

Embed code

<embed src="http://mywebsite.com/streamer.php?file=video.flv" />

Tried also in HTML5 and in another video format

<video id="vid">
   <source src="http://chris-mmt.site40.net/streamer.php?file=video.mp4" type="video/mp4">
</video>
Odin
  • 642
  • 1
  • 9
  • 27

1 Answers1

0

I solved my problem by using the HTML5 method and thanks to this answer I got it working just fine:)

WebView and HTML5 <video>

Community
  • 1
  • 1
Odin
  • 642
  • 1
  • 9
  • 27