|
Written by Administrator
|
|
Sunday, 25 February 2007 09:15 |
|
if you're looking for a low cost streaming solution, you might want to consider using something like flv4php.
Here is a small code eksamble on how you could do this, using flv4php. Streaming with php ? no problem <?php $path = '/path/to/flv/files/'; // Path to flv files (could be behind web root) if( ! isset($_GET["offset"]) ) $_GET["offset"] = 10000; if( ! isset($_GET["duration"]) ) $_GET["duration"] = 5000; if( ! isset($_GET["speed"]) ) $_GET["speed"] = 100; require_once('/path/to/flv4php/FLV.php'); // Path to flv.php / (flv4php) $flv = new FLV($file); if( $_GET["type"] == "thumb" ) { echo $flv-> getFlvThumb($_GET["offset"]); } else if( $_GET["type"] == "metadata" ) { $newMetaData = $flv->defaultMetaData(true); $metadata = $flv->createMetaData($newMetaData); } else if( $_GET["type"] == "preview" ) { echo $flv-> getFlvPreview($_GET["offset"], $_GET["duration"], true, $_GET["speed"]); } else { // $flv->playFlvLock(1,$_GET["position"],false,true,true); // stream using lock system $flv->playFlv(1,$_GET["position"]); // public stream, less "secure" } } else { } ?>
This is an easy wat to stream your flv files via http protocol. You can see an eksamble here on how it could work in real life |
|
Last Updated on Monday, 25 August 2008 16:38 |