비효율적인 비디오 스트리밍 로직 개선

This commit is contained in:
static
2026-01-17 18:25:54 +09:00
parent d8e18fb1d3
commit befa535526

View File

@@ -62,9 +62,7 @@ const streamFromServer = async (
) => {
const totalSize = getDecryptedSize(metadata.encContentSize, metadata.isLegacy);
const start = range?.start ?? 0;
const end =
range?.end ??
(range && !metadata.isLegacy ? Math.min(start + CHUNK_SIZE, totalSize) : totalSize) - 1;
const end = range?.end ?? totalSize - 1;
if (start > end || start < 0 || end >= totalSize) {
return new Response("Invalid range", { status: 416 });
}