feat: videoplayer toegevoegd
This commit is contained in:
@@ -86,6 +86,17 @@ class FilesystemAdapter:
|
||||
"modified": self.modified_iso(path),
|
||||
}
|
||||
|
||||
async def stream_file_range(self, path: Path, start: int, end: int, chunk_size: int = 1024 * 1024):
|
||||
with path.open("rb") as handle:
|
||||
handle.seek(start)
|
||||
remaining = (end - start) + 1
|
||||
while remaining > 0:
|
||||
chunk = handle.read(min(chunk_size, remaining))
|
||||
if not chunk:
|
||||
break
|
||||
remaining -= len(chunk)
|
||||
yield chunk
|
||||
|
||||
@staticmethod
|
||||
def modified_iso(path: Path) -> str:
|
||||
stat = path.stat()
|
||||
|
||||
Reference in New Issue
Block a user