From 7655c5580c97fe00a786c90740d221f252d9493c Mon Sep 17 00:00:00 2001 From: Alan Hardman Date: Tue, 4 Sep 2018 10:57:06 -0600 Subject: [PATCH] Allow streaming video files, sort of. This ideally should be expanded to allow reading attachments from specific start positions, further expanding what's possible with streaming large video files directly. For now, this will send the entire video as a single response, and the browser can choose to play it if that functionality is supported for the container and codec. --- app/controller/files.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controller/files.php b/app/controller/files.php index 11a51ef3..d02d3695 100644 --- a/app/controller/files.php +++ b/app/controller/files.php @@ -261,7 +261,8 @@ public function file($f3, $params) $force = true; if (substr($file->content_type, 0, 5) == "image" || $file->content_type == "text/plain" || - $file->content_type == "application/pdf" + $file->content_type == "application/pdf" || + in_array($file->content_type, ['video/mp4', 'video/webm']) ) { $force = false; }