From 6eb1c93882db5ce8cd68f9e2b09f1db89b1669d4 Mon Sep 17 00:00:00 2001 From: Zlendy Date: Thu, 27 Aug 2026 15:27:27 +0200 Subject: [PATCH] fix(web): do not play memory video if the `MemoryVideoViewer` element is not visible (#30947) --- .../[id]/[[photos=photos]]/[[assetId=id]]/MemoryViewer.svelte | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/web/src/routes/(user)/memories/[id]/[[photos=photos]]/[[assetId=id]]/MemoryViewer.svelte b/web/src/routes/(user)/memories/[id]/[[photos=photos]]/[[assetId=id]]/MemoryViewer.svelte index bee691c4f..2ee2023a4 100644 --- a/web/src/routes/(user)/memories/[id]/[[photos=photos]]/[[assetId=id]]/MemoryViewer.svelte +++ b/web/src/routes/(user)/memories/[id]/[[photos=photos]]/[[assetId=id]]/MemoryViewer.svelte @@ -172,7 +172,8 @@ galleryInView = false; // only call play after the first page load. When page first loads the gallery will not be visible // and calling play here will result in duplicate invocation. - if (!galleryFirstLoad) { + // also check if the element is visible to avoid playback in the background + if (!galleryFirstLoad && videoPlayer?.checkVisibility()) { handlePromiseError(handleAction('galleryOutOfView', 'play')); } galleryFirstLoad = false;