diff --git a/core/src/plugins/editor.video/class.VideoReader.php b/core/src/plugins/editor.video/class.VideoReader.php old mode 100644 new mode 100755 index 9969b6fee5..b491877a14 --- a/core/src/plugins/editor.video/class.VideoReader.php +++ b/core/src/plugins/editor.video/class.VideoReader.php @@ -75,7 +75,8 @@ public function switchAction($action, $httpVars, $filesVars) $this->logInfo('Preview', 'Streaming content of '.$file); } - $length = floatval($offsets[1]) - $offset; + $length = floatval($offsets[1]) - $offset + 1; + if (!$length) $length = $filesize - $offset; if ($length + $offset > $filesize || $length < 0) $length = $filesize - $offset; header('HTTP/1.1 206 Partial Content'); @@ -98,7 +99,12 @@ public function switchAction($action, $httpVars, $filesVars) while(ob_get_level()) ob_end_flush(); $readSize = 0.0; while (!feof($file) && $readSize < $length && connection_status() == 0) { - echo fread($file, 2048); + if ($length < 2048){ + echo fread($file, $length); + } else { + echo fread($file, 2048); + } + $readSize += 2048.0; flush(); }