immich/web/src/lib/components/asset-viewer/video-wrapper-viewer.svelte
Jason Rasmussen f386b4d377
feat(web): use thumbhash as a cache key (#16106)
Co-authored-by: Alex <alex.tran1502@gmail.com>
2025-02-16 03:34:13 +00:00

44 lines
1,021 B
Svelte

<script lang="ts">
import { ProjectionType } from '$lib/constants';
import VideoNativeViewer from '$lib/components/asset-viewer/video-native-viewer.svelte';
import VideoPanoramaViewer from '$lib/components/asset-viewer/video-panorama-viewer.svelte';
interface Props {
assetId: string;
projectionType: string | null | undefined;
cacheKey: string | null;
loopVideo: boolean;
onClose?: () => void;
onPreviousAsset?: () => void;
onNextAsset?: () => void;
onVideoEnded?: () => void;
onVideoStarted?: () => void;
}
let {
assetId,
projectionType,
cacheKey,
loopVideo,
onPreviousAsset,
onClose,
onNextAsset,
onVideoEnded,
onVideoStarted,
}: Props = $props();
</script>
{#if projectionType === ProjectionType.EQUIRECTANGULAR}
<VideoPanoramaViewer {assetId} />
{:else}
<VideoNativeViewer
{loopVideo}
{cacheKey}
{assetId}
{onPreviousAsset}
{onNextAsset}
{onVideoEnded}
{onVideoStarted}
{onClose}
/>
{/if}