From eb618e0ccdc230d6d6fa0004816edf729b4a65f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Ml=C3=A1dek?= Date: Sat, 30 Apr 2022 20:29:07 +0200 Subject: [PATCH] [ui] video viewer improvements fix layout before thumb loads fix vertical overflow don't start video on thumb click --- .../display/blobs/VideoViewer.svelte | 33 +++++++++++++++---- 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/webui/src/components/display/blobs/VideoViewer.svelte b/webui/src/components/display/blobs/VideoViewer.svelte index 9701aae..4212e03 100644 --- a/webui/src/components/display/blobs/VideoViewer.svelte +++ b/webui/src/components/display/blobs/VideoViewer.svelte @@ -17,7 +17,7 @@ let videoEl: HTMLVideoElement; const seek = throttle((progress: number) => { - if (state === State.PREVIEWING) { + if (state === State.PREVIEWING && videoEl.duration) { videoEl.currentTime = videoEl.duration * progress; } }, 100); @@ -39,8 +39,10 @@ } function startPlaying() { - state = State.PLAYING; - videoEl.play(); + if (detail) { + state = State.PLAYING; + videoEl.play(); + } } @@ -49,6 +51,7 @@ {address} (state = State.PREVIEW)} @@ -78,11 +81,23 @@