1
0
Fork 0
mirror of https://github.com/immich-app/immich.git synced 2024-12-29 15:11:58 +00: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 { fade } from 'svelte/transition';
import { createEventDispatcher } from 'svelte';
import { videoViewerVolume } from '$lib/stores/preferences.store';
import LoadingSpinner from '../shared-components/loading-spinner.svelte';
export let assetId: string;
@ -30,6 +31,7 @@
class="h-full object-contain"
on:canplay={handleCanPlay}
on:ended={() => dispatch('onVideoEnded')}
bind:volume={$videoViewerVolume}
>
<source src={api.getAssetFileUrl(assetId, false, true, publicSharedKey)} type="video/mp4" />
<track kind="captions" />

View file

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