feat: add video auto play setting (#20416)

* feat: add auto play setting to mobile

* feat: add auto play video setting to web

* address review comments

* fix setting id

---------

Co-authored-by: Saschl <noreply@saschl.com>
This commit is contained in:
Saschl
2025-10-15 17:24:47 +02:00
committed by GitHub
parent 7d0228a159
commit 9b5855f848
11 changed files with 41 additions and 5 deletions

View File

@@ -1,6 +1,7 @@
<script lang="ts">
import { assetViewerFadeDuration } from '$lib/constants';
import type { TimelineAsset } from '$lib/managers/timeline-manager/types';
import { autoPlayVideo } from '$lib/stores/preferences.store';
import { getAssetPlaybackUrl, getAssetThumbnailUrl } from '$lib/utils';
import { AssetMediaSize } from '@immich/sdk';
import { onMount } from 'svelte';
@@ -27,7 +28,7 @@
<div class="h-full w-full bg-pink-9000" transition:fade={{ duration: assetViewerFadeDuration }}>
<video
bind:this={videoPlayer}
autoplay
autoplay={$autoPlayVideo}
playsinline
class="h-full w-full rounded-2xl object-contain transition-all"
src={getAssetPlaybackUrl({ id: asset.id })}