1
0
mirror of https://github.com/danog/MadelineProto.git synced 2024-11-30 07:58:58 +01:00

Revert "Revert "Fix: safari requires one big range of video""

This reverts commit b2a8038b30.
This commit is contained in:
Alexander Pankratov 2023-04-18 12:11:21 +02:00
parent b2a8038b30
commit 4b6b9d980b

View File

@ -100,6 +100,13 @@ final class ResponseInfo
}
$seek_start = empty($seek_start) ? 0 : \abs(\intval($seek_start));
//Safari video streaming fix
$length = ($seek_end - $seek_start + 1);
$maxChunkSize = 10 * 1024 ** 2;
if ($length > $maxChunkSize) {
$seek_end = $seek_start + $maxChunkSize - 1;
}
$this->serve = $method !== 'HEAD';
if ($seek_start > 0 || $seek_end < $size - 1) {
$this->code = HttpStatus::PARTIAL_CONTENT;