mirror of
https://github.com/immich-app/immich.git
synced 2026-03-09 11:23:46 -04:00
fix(web): video stealing focus when it plays again when looping (#26704)
This commit is contained in:
parent
c259fee309
commit
09fabb36b6
@ -50,6 +50,7 @@
|
||||
);
|
||||
let isScrubbing = $state(false);
|
||||
let showVideo = $state(false);
|
||||
let hasFocused = $state(false);
|
||||
|
||||
onMount(() => {
|
||||
// Show video after mount to ensure fading in.
|
||||
@ -59,6 +60,7 @@
|
||||
$effect(() => {
|
||||
// reactive on `assetFileUrl` changes
|
||||
if (assetFileUrl) {
|
||||
hasFocused = false;
|
||||
videoPlayer?.load();
|
||||
}
|
||||
});
|
||||
@ -151,7 +153,10 @@
|
||||
onseeking={() => (isScrubbing = true)}
|
||||
onseeked={() => (isScrubbing = false)}
|
||||
onplaying={(e) => {
|
||||
e.currentTarget.focus();
|
||||
if (!hasFocused) {
|
||||
e.currentTarget.focus();
|
||||
hasFocused = true;
|
||||
}
|
||||
}}
|
||||
onclose={() => onClose()}
|
||||
muted={$videoViewerMuted}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user