1
0
mirror of https://github.com/immich-app/immich.git synced 2024-12-26 10:50:29 +02:00

fix(web): keep video volume (#2897)

* save video volume in asset-interaction.store.ts

* move video-viewer-volume to preferences store
save in localstorage by using persisted
This commit is contained in:
faupau 2023-06-21 16:59:13 +02:00 committed by GitHub
parent 82b89aa20b
commit de7f66f983
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View File

@ -2,6 +2,7 @@
import { api } from '@api'; import { api } from '@api';
import { fade } from 'svelte/transition'; import { fade } from 'svelte/transition';
import { createEventDispatcher } from 'svelte'; import { createEventDispatcher } from 'svelte';
import { videoViewerVolume } from '$lib/stores/preferences.store';
import LoadingSpinner from '../shared-components/loading-spinner.svelte'; import LoadingSpinner from '../shared-components/loading-spinner.svelte';
export let assetId: string; export let assetId: string;
@ -30,6 +31,7 @@
class="h-full object-contain" class="h-full object-contain"
on:canplay={handleCanPlay} on:canplay={handleCanPlay}
on:ended={() => dispatch('onVideoEnded')} on:ended={() => dispatch('onVideoEnded')}
bind:volume={$videoViewerVolume}
> >
<source src={api.getAssetFileUrl(assetId, false, true, publicSharedKey)} type="video/mp4" /> <source src={api.getAssetFileUrl(assetId, false, true, publicSharedKey)} type="video/mp4" />
<track kind="captions" /> <track kind="captions" />

View File

@ -35,3 +35,5 @@ export const mapSettings = persisted<MapSettings>('map-settings', {
dateAfter: '', dateAfter: '',
dateBefore: '' dateBefore: ''
}); });
export const videoViewerVolume = persisted<number>('video-viewer-volume', 1, {});