fix: video/audio streaming instead of blob download
All checks were successful
Build Archipelago ISO (dev) / build-iso (push) Successful in 33m23s
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user