mirror of
https://github.com/immich-app/immich.git
synced 2024-11-15 18:08:48 -07:00
fix(web): stream 360 video instead of fetching entire video (#9279)
This commit is contained in:
parent
f08e9a4447
commit
bc31404909
@ -2,7 +2,7 @@
|
||||
import { serveFile, type AssetResponseDto, AssetTypeEnum } from '@immich/sdk';
|
||||
import { fade } from 'svelte/transition';
|
||||
import LoadingSpinner from '../shared-components/loading-spinner.svelte';
|
||||
import { getKey } from '$lib/utils';
|
||||
import { getAssetFileUrl, getKey } from '$lib/utils';
|
||||
import type { AdapterConstructor, PluginConstructor } from '@photo-sphere-viewer/core';
|
||||
export let asset: Pick<AssetResponseDto, 'id' | 'type'>;
|
||||
|
||||
@ -19,11 +19,11 @@
|
||||
: ([undefined, [], false] as [undefined, [], false]);
|
||||
|
||||
const loadAssetData = async () => {
|
||||
if (asset.type === AssetTypeEnum.Video) {
|
||||
return { source: getAssetFileUrl(asset.id, false, false) };
|
||||
}
|
||||
const data = await serveFile({ id: asset.id, isWeb: false, isThumb: false, key: getKey() });
|
||||
const url = URL.createObjectURL(data);
|
||||
if (asset.type === AssetTypeEnum.Video) {
|
||||
return { source: url };
|
||||
}
|
||||
return url;
|
||||
};
|
||||
</script>
|
||||
|
Loading…
Reference in New Issue
Block a user