You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 28, 2024. It is now read-only.
Not sure if you're talking about in Browser or by Webdav (I'm not the brightest bulbs)
However, will confirm that this happens both on PHP 4.7.10 and PHP-FPM 4.7.10 in the web browser. Not sure about with Webdav. File locking with redis and distributing both being enabled has the same result as well.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Expected behaviour
Load the video only for the part to be played.
Actual behaviour
Read all files the moment you play.
Steps to reproduce
Play the video in your browser.
How to improve I think
You should create a new remote.php alternative without using remote.php.
To do that
$dir //Video file location
$size = filesize($dir);
$fp = fopen($dir,"rb");
$etag = md5($_SERVER["REQUEST_URI"]).$size;
if(@$_SERVER["HTTP_RANGE"]){
list($start,$end) = sscanf($_SERVER["HTTP_RANGE"],"bytes=%d-%d");
if(empty($end)) $end = $start + 10000000 - 1;
if($end>=($size-1)) $end = $size - 1;
header("HTTP/1.1 206 Partial Content");
header("Content-Range: bytes {$start}-{$end}/{$size}");
$size = $end - $start + 1;
fseek($fp,$start);
}
header("Accept-Ranges: bytes");
header("Content-Type: video/mp4");
header("Content-Length: {$size}");
header("Etag: "{$etag}"");
//if($size) echo fread($fp,$size);
echo fread($fp,10000000);
ob_flush();
fclose($fp);
The text was updated successfully, but these errors were encountered: