-
-
Notifications
You must be signed in to change notification settings - Fork 171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Video files (.mp4) cannot be loaded by Safari #1207
Comments
Closing this, since it seems to be a problem with the PHP localhost server, unrelated to Kirby. |
@robinscholz The same problem occurs with us not only with a PHP localhost server. Can you recommend server settings that worked for you? |
@robinscholz no, it's not a problem with the PHP localhost server. On the very first request for a video (that's not in the On subsequent requests, the video file now exists in the You should reopen this. We have this issue on production and we always have to purge the cache the first time a new video is uploaded because it's incorrectly served. |
Ideas where to tackle this:
$handle = fopen($file, 'rb');
fseek($handle, $start);
if ($end === $size) {
fpassthru($handle);
} else {
$step = 8 * KB_IN_BYTES;
$remaining = $end - $start;
while (
$remaining &&
!feof($handle) &&
$chunk = fread($handle, min($step, $remaining))
) {
$remaining -= strlen($step);
echo $chunk;
flush();
}
}
fclose( $handle ); |
The question is if the |
@lukasbestle the easier way would probably yo do it within the/a |
Easiest, definitely. But won't we shoot ourselves in the foot by attaching the two classes so closely together? Especially because we need to get "the" request object from the app instance. Maybe we could have a |
I started something #5153 |
Describe the bug
Safari needs the server to support byte-range requests. Instead of simply requesting the video, Safari first sends a byte range request:
and expects the response status
206
. Kirby currently responds with200
. Safari then aborts its request instead of sending various others for the complete range of bytes.To Reproduce
Steps to reproduce the behavior:
/media/
URLExpected behavior
Kirby should respond with code
206
for the initial response to a video file request.Kirby Version
3.0.0-beta-6.21
Console output
Failed to load resource: Plug-in handled load
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: