diff --git a/include/videos.php b/include/videos.php index 4e6215815b8f5cb741418153c88a8f825cc5253b..d06cdd972912d4425e5c20cc9e12c66594dff2ce 100644 --- a/include/videos.php +++ b/include/videos.php @@ -161,7 +161,14 @@ function getVideo() { header('Content-Transfer-Encoding: binary;'); header('Content-Length: ' . filesize($video["video_path"]).';'); flush(); - readfile($video["video_path"]); + //We now push by block of 10M to save memory consumption of readfile + //readfile($video["video_path"]); + $fd = fopen($video["video_path"], 'rb'); + while (!feof($fd)) { + $buf = fread($fd, 10485760); + echo $buf; + } + fclose($fd); } else { header("Status: 404 Not Found");