Skip to content

Commit 1fa7f2a

Browse files
committed
Added support for video files
1 parent ae9dc0f commit 1fa7f2a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

index.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,13 @@ function replaceVariables($str){
397397
}
398398

399399
// return contents of file
400-
header('Content-Type: '.file_to_mime($file));
400+
$mimeType = file_to_mime($file);
401+
header('Content-Type: '.$mimeType);
402+
if($mimeType === 'video/quicktime' || $mimeType === 'video/mp4' || $mimeType === 'video/x-m4v' || $mimeType === 'video/3gpp'){
403+
// video files
404+
header('Content-Length: '.filesize($file));
405+
header('Accept-Ranges: bytes');
406+
}
401407
echo file_get_contents($file);
402408
exit(0);
403409
}

0 commit comments

Comments
 (0)