Files
immich/web/src/lib/components/asset-viewer/video-wrapper-viewer.svelte
T
midzelis e79a98fa82 feat(web): view transitions from timeline to viewer
Change-Id: I0a37b417ee4c247dcc93d442c976eede6a6a6964
2026-03-24 15:43:06 +00:00

57 lines
1.4 KiB
Svelte

<script lang="ts">
import VideoNativeViewer from '$lib/components/asset-viewer/video-native-viewer.svelte';
import VideoPanoramaViewer from '$lib/components/asset-viewer/video-panorama-viewer.svelte';
import { ProjectionType } from '$lib/constants';
import type { AssetResponseDto } from '@immich/sdk';
type Props = {
transitionName?: string;
asset: AssetResponseDto;
assetId?: string;
projectionType: string | null | undefined;
cacheKey: string | null;
loopVideo: boolean;
playOriginalVideo: boolean;
onClose?: () => void;
onPreviousAsset?: () => void;
onNextAsset?: () => void;
onVideoEnded?: () => void;
onVideoStarted?: () => void;
};
let {
transitionName,
asset,
assetId,
projectionType,
cacheKey,
loopVideo,
playOriginalVideo,
onPreviousAsset,
onClose,
onNextAsset,
onVideoEnded,
onVideoStarted,
}: Props = $props();
const effectiveAssetId = $derived(assetId ?? asset.id);
</script>
{#if projectionType === ProjectionType.EQUIRECTANGULAR}
<VideoPanoramaViewer {transitionName} {asset} />
{:else}
<VideoNativeViewer
{transitionName}
{loopVideo}
{cacheKey}
assetId={effectiveAssetId}
imageSize={{ width: asset.width ?? 1, height: asset.height ?? 1 }}
{playOriginalVideo}
{onPreviousAsset}
{onNextAsset}
{onVideoEnded}
{onVideoStarted}
{onClose}
/>
{/if}