From de7f66f9834f4d9b90558a60a72052b80b453e7a Mon Sep 17 00:00:00 2001 From: faupau Date: Wed, 21 Jun 2023 16:59:13 +0200 Subject: [PATCH] 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 --- web/src/lib/components/asset-viewer/video-viewer.svelte | 2 ++ web/src/lib/stores/preferences.store.ts | 2 ++ 2 files changed, 4 insertions(+) diff --git a/web/src/lib/components/asset-viewer/video-viewer.svelte b/web/src/lib/components/asset-viewer/video-viewer.svelte index c931100c2a..801768dd8e 100644 --- a/web/src/lib/components/asset-viewer/video-viewer.svelte +++ b/web/src/lib/components/asset-viewer/video-viewer.svelte @@ -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} > diff --git a/web/src/lib/stores/preferences.store.ts b/web/src/lib/stores/preferences.store.ts index b0f491a3a7..e65c9c68bb 100644 --- a/web/src/lib/stores/preferences.store.ts +++ b/web/src/lib/stores/preferences.store.ts @@ -35,3 +35,5 @@ export const mapSettings = persisted('map-settings', { dateAfter: '', dateBefore: '' }); + +export const videoViewerVolume = persisted('video-viewer-volume', 1, {});