mirror of
https://github.com/immich-app/immich.git
synced 2025-05-31 12:15:47 -04:00
fix(web): Fixed video unmutes when scrubbing (#9382)
Fixed video unmutes when scrubbing Co-authored-by: Tushar Harsora <tushar.harsora.harsora@oracle.com>
This commit is contained in:
parent
bb4843747b
commit
dd8d7732de
@ -1,5 +1,5 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { videoViewerVolume } from '$lib/stores/preferences.store';
|
import { videoViewerVolume, videoViewerMuted } from '$lib/stores/preferences.store';
|
||||||
import { getAssetFileUrl, getAssetThumbnailUrl } from '$lib/utils';
|
import { getAssetFileUrl, getAssetThumbnailUrl } from '$lib/utils';
|
||||||
import { handleError } from '$lib/utils/handle-error';
|
import { handleError } from '$lib/utils/handle-error';
|
||||||
import { ThumbnailFormat } from '@immich/sdk';
|
import { ThumbnailFormat } from '@immich/sdk';
|
||||||
@ -17,9 +17,7 @@
|
|||||||
const handleCanPlay = async (event: Event) => {
|
const handleCanPlay = async (event: Event) => {
|
||||||
try {
|
try {
|
||||||
const video = event.currentTarget as HTMLVideoElement;
|
const video = event.currentTarget as HTMLVideoElement;
|
||||||
video.muted = true;
|
|
||||||
await video.play();
|
await video.play();
|
||||||
video.muted = false;
|
|
||||||
dispatch('onVideoStarted');
|
dispatch('onVideoStarted');
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
handleError(error, 'Unable to play video');
|
handleError(error, 'Unable to play video');
|
||||||
@ -42,6 +40,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:muted={$videoViewerMuted}
|
||||||
bind:volume={$videoViewerVolume}
|
bind:volume={$videoViewerVolume}
|
||||||
poster={getAssetThumbnailUrl(assetId, ThumbnailFormat.Jpeg)}
|
poster={getAssetThumbnailUrl(assetId, ThumbnailFormat.Jpeg)}
|
||||||
>
|
>
|
||||||
|
@ -63,6 +63,7 @@ export const mapSettings = persisted<MapSettings>('map-settings', {
|
|||||||
});
|
});
|
||||||
|
|
||||||
export const videoViewerVolume = persisted<number>('video-viewer-volume', 1, {});
|
export const videoViewerVolume = persisted<number>('video-viewer-volume', 1, {});
|
||||||
|
export const videoViewerMuted = persisted<boolean>('video-viewer-muted', false, {});
|
||||||
|
|
||||||
export const isShowDetail = persisted<boolean>('info-opened', false, {});
|
export const isShowDetail = persisted<boolean>('info-opened', false, {});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user