mirror of
https://github.com/immich-app/immich.git
synced 2026-05-22 07:32:32 -04:00
affe0ac5ee
* feat(web): custom video player controls * add seek & rate buttons * wrap memory viewer in media-controller for muted/volume store * fix memories * disable video shortcut keys * re-add playsinline for safari iphone playback * fix black screen issue * always display time range * remove seek buttons and center controls, and put time range above controls * change ui * update memory viewer * fix full width on video player on safari * enhance video player layout by ensuring full width and maintaining aspect ratio * layout: don't shrink buttons, tabular time text --------- Co-authored-by: timonrieger <mail@timonrieger.de>
57 lines
1.3 KiB
Svelte
57 lines
1.3 KiB
Svelte
<script lang="ts">
|
|
import VideoNativeViewer from '$lib/components/asset-viewer/VideoNativeViewer.svelte';
|
|
import VideoPanoramaViewer from '$lib/components/asset-viewer/VideoPanoramaViewer.svelte';
|
|
import { ProjectionType } from '$lib/constants';
|
|
import type { AssetResponseDto } from '@immich/sdk';
|
|
|
|
interface Props {
|
|
asset: AssetResponseDto;
|
|
assetId?: string;
|
|
projectionType: string | null | undefined;
|
|
cacheKey: string | null;
|
|
loopVideo: boolean;
|
|
playOriginalVideo: boolean;
|
|
extendedControls?: boolean;
|
|
onClose?: () => void;
|
|
onPreviousAsset?: () => void;
|
|
onNextAsset?: () => void;
|
|
onVideoEnded?: () => void;
|
|
onVideoStarted?: () => void;
|
|
}
|
|
|
|
let {
|
|
asset,
|
|
assetId,
|
|
projectionType,
|
|
cacheKey,
|
|
loopVideo,
|
|
playOriginalVideo,
|
|
extendedControls = false,
|
|
onPreviousAsset,
|
|
onClose,
|
|
onNextAsset,
|
|
onVideoEnded,
|
|
onVideoStarted,
|
|
}: Props = $props();
|
|
|
|
const effectiveAssetId = $derived(assetId ?? asset.id);
|
|
</script>
|
|
|
|
{#if projectionType === ProjectionType.EQUIRECTANGULAR}
|
|
<VideoPanoramaViewer {asset} />
|
|
{:else}
|
|
<VideoNativeViewer
|
|
{loopVideo}
|
|
{cacheKey}
|
|
{asset}
|
|
assetId={effectiveAssetId}
|
|
{playOriginalVideo}
|
|
{extendedControls}
|
|
{onPreviousAsset}
|
|
{onNextAsset}
|
|
{onVideoEnded}
|
|
{onVideoStarted}
|
|
{onClose}
|
|
/>
|
|
{/if}
|