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

Merge pull request #1334 from danog/v8_safari_fix_2

V8 safari fix 2
This commit is contained in:
Daniil Gentili 2023-04-18 12:50:25 +02:00 committed by GitHub
commit 1257c0511e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -100,6 +100,16 @@ final class ResponseInfo
}
$seek_start = empty($seek_start) ? 0 : \abs(\intval($seek_start));
if ($range !== '') {
//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;