diff --git a/src/MTProtoTools/ResponseInfo.php b/src/MTProtoTools/ResponseInfo.php index f1b795753..d86ba1755 100644 --- a/src/MTProtoTools/ResponseInfo.php +++ b/src/MTProtoTools/ResponseInfo.php @@ -106,14 +106,15 @@ final class ResponseInfo } $seek_start = empty($seek_start) ? 0 : \abs(\intval($seek_start)); - /*if ($range !== '') { + $isSafari = !empty($headers['user-agent']) && preg_match('/^((?!chrome|android).)*safari/i', $headers['user-agent']); + if ($range !== '' && $isSafari) { //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) {