From 6f141ef1c56dc0114e8dbd0c460167fadb771293 Mon Sep 17 00:00:00 2001 From: yibo Date: Wed, 2 Sep 2026 20:02:02 +0800 Subject: [PATCH] Show a first-frame thumbnail on each preview player --- admin.html | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/admin.html b/admin.html index bb12a63..8af7ecb 100644 --- a/admin.html +++ b/admin.html @@ -182,6 +182,17 @@ function videoHref(c) { return `/lib/video/${c.id}`; } +const previewObserver = new IntersectionObserver( + (entries) => { + for (const e of entries) { + if (!e.isIntersecting) continue; + e.target.src = e.target.dataset.src; + previewObserver.unobserve(e.target); + } + }, + { rootMargin: "200px" } +); + function render() { const rows = filteredSorted(); const channelTotal = library.filter(inChannel).length; @@ -202,7 +213,7 @@ function render() { - +