fix: video/audio streaming instead of blob download
All checks were successful
Build Archipelago ISO (dev) / build-iso (push) Successful in 33m23s

Videos and audio now stream directly via URL with auth token query
param instead of downloading entire file into a JS blob. Fixes
playback of large videos (170MB+ was timing out). Images still use
blob URLs. streamUrl() added to filebrowser client and cloud store.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Dorian
2026-04-12 00:45:42 -04:00
parent 0e9c1ed18b
commit 6890dc95ba
4 changed files with 34 additions and 5 deletions

View File

@@ -117,6 +117,7 @@ const props = defineProps<{
startIndex: number
show: boolean
fetchBlobUrl: (path: string) => Promise<string>
streamUrl?: (path: string) => Promise<string>
}>()
const emit = defineEmits<{
@@ -167,9 +168,18 @@ async function loadMedia(item: FileBrowserItem) {
if (cached) {
currentUrl.value = cached
} else {
const url = await props.fetchBlobUrl(item.path)
urlCache.set(item.path, url)
currentUrl.value = url
// Use streaming URL for video/audio (avoids downloading entire file into blob)
// Use blob URL for images (needed for rendering)
const isStreamable = isVideoFile(item) || isAudioFile(item)
if (isStreamable && props.streamUrl) {
const url = await props.streamUrl(item.path)
urlCache.set(item.path, url)
currentUrl.value = url
} else {
const url = await props.fetchBlobUrl(item.path)
urlCache.set(item.path, url)
currentUrl.value = url
}
}
} catch {
mediaError.value = true