Thursday, July 29th 2010, 1:24pm UTC+2
You are not logged in.
Dear visitor, welcome to Flashbattle.de - Flashforum / Webdesign Community & Developer`s Page . If this is your first visit here, please read the Help. It explains how this page works. You must be registered before you can use all the page's features. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.
|
|
PHP Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
<?php
/*
php xmoothStream
by: Eric Lorenzo Benjamin jr. (freaklancer (AT) gmx (DOT) net)
This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License.
To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/
or send a letter to Creative Commons, 543 Howard Street, 5th Floor, San Francisco, California, 94105, USA.
*/
$root = './';
$path = '';
if(isset($_GET["file"]) && isset($_GET["position"]))
{
$seekPos = $_GET["position"];
$fileName = htmlspecialchars($_GET["file"]);
$file = $root . $path . $fileName;
if(file_exists($file) && fileOk($fileName) && someOtherTesting($file))
{
$fh = fopen($file, "rb");
fseek($fh, 0, SEEK_END); $seek_end = ftell($fh); /* get end of file */
fseek($fh, $seekPos); $seek_start = ftell($fh); /* get seek position */
$fileSize = $seek_end - $seek_start; /* calculate new file size */
session_cache_limiter('nocache');
header("Expires: Thu, 19 Nov 1981 08:52:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
/* HTTP/1.1 clients and the rest (MSIE 5) */
header("Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0");
/* HTTP/1.0 clients */
header("Pragma: no-cache");
header("Content-Type: video/x-flv");
header("Content-Disposition: attachment; filename=\"" . $fileName . "\"");
header('Content-Length: ' . $fileSize); /* send new file size to flv player */
if($seekPos != 0)
{
print("FLV");
print(pack('C', 1 ));
print(pack('C', 1 ));
print(pack('N', 9 ));
print(pack('N', 9 ));
}
fseek($fh, $seekPos);
while (!feof($fh))
{
print (fread($fh, 16384));
}
fclose($fh);
}
}
function fileOk ($fileName)
{
$ok = true;
$ok = (strrchr($fileName, ".") == ".flv") ? $ok : false;
$ok = (strlen($fileName) > 2 && !eregi(basename($_SERVER['PHP_SELF']), $fileName) && ereg('^[^./][^/]*$', $fileName)) ? $ok : false;
return $ok;
}
function someOtherTesting($file)
{
return true;
}
?>
|
This post has been edited 1 times, last edit by "freaklancer" (Apr 2nd 2007, 4:48am)



This post has been edited 1 times, last edit by "freaklancer" (Apr 2nd 2007, 9:03pm)


This post has been edited 1 times, last edit by "freaklancer" (Apr 2nd 2007, 10:25pm)






und nicht für den 4.ten...
Quoted
und wieder einer der nur klugscheissen kann und kein beitrag zum thema leisten kann.


Quoted
How does it work ?
FLV Metadata Injector (PC only) from Buraks allows you to inject an object containing two arrays into the FLV's metadata.
This object contains the exact starting position in bytes and timecode of each keyframe.
Using this specific information user can request any part of the FLV file starting at a specified keyframe.

Quoted
It is a kind of 'progressive download' offering immediate random access to different parts of a movie.

Quoted
KELOR DAS IST EURE 1. UND EINZIGE VERWARUNG
wenn ich dich währe würd ich alles noch mal durch lesen und überlegen ob du nicht dein verwarung zurrück nehmst. sonst lösche ich eh mein profil.


Ich selbst Arbeite seit etlichen Jahren im Bereich Linux Administration sowie im Scripting Bereich PHP/Perl/C/C++ und Bash im Freelancer Bereich. Daher verwundert es mich um so mehr das du für so etwas Zeit verschwendest. Im übrigen hast du meine Aussage zur Brotlosen Kunst selbst hervor gerufen. Ich hatte in meinem ersten Posting lediglich geschrieben das dies kein Stream ist und später auch begründet.
Quoted
...mann hat keine ahnung worum es bei php flv streaming geht..
This post has been edited 2 times, last edit by "flashbattler" (May 15th 2007, 6:35pm)

Quoted
Original von flashbattler
was genau Deine Header-Bearbeitung in Deinem eingangs geposteten Script im Gegensatz zu dem flvprovider.php im ebenfalls von Dir verlinkten phpstream.zip bewirkt ? Hab beide php-Scripte mal ausprobiert und merke keinen wirklichen Unterschied.
This post has been edited 1 times, last edit by "freaklancer" (May 15th 2007, 7:29pm)

This post has been edited 1 times, last edit by "flashbattler" (May 16th 2007, 10:40am)

Quoted
Original von freaklancer
wenn mann ein video lädt bekommt mann eimma bytesTotal und noch ne bytesLoaded wert.
aber was passiert mit bytesTotal wenn mann zu ein anderen teil des videos springt?
es wird -1 bis das ganze video fertig geladen ist dann springt es plözlich auf sein korrekten bytesTotal wert.