From 274ff80b343dbf3a4ef1b9dfd383b765c6ea30d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastjan=20Arti=C4=8D?= Date: Thu, 30 Apr 2026 11:51:31 +0000 Subject: [PATCH] Edit: play selection feature MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Big '▶ Predvajaj odsek' button: plays from trim start - Auto-stop when video reaches trim end (loops back to trim start) - iPhone trim preview behavior: see exactly what reel will contain --- templates/index.html | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/templates/index.html b/templates/index.html index ef12b47..a1887dd 100644 --- a/templates/index.html +++ b/templates/index.html @@ -1058,14 +1058,14 @@ -
+
Začetek: ${formatTime(startInit)} Konec: ${formatTime(endInit)} Trajanje: ${(endInit-startInit).toFixed(1)}s
- +
@@ -1215,9 +1215,21 @@ if (!video) return; const t = which === "start" ? trimStart : trimEnd; video.currentTime = t; - if (which === "start") video.play(); + if (which === "start") { + video.play(); + } }; + // Auto-stop predvajanje ko doseže trimEnd (kot iPhone trim preview) + if (video) { + video.addEventListener("timeupdate", () => { + if (!video.paused && video.currentTime >= trimEnd) { + video.pause(); + video.currentTime = trimStart; // reset na začetek označenega dela + } + }); + } + // Initial render — počakaj da DOM ima dimenzije (modal je bil pravkar dodan) console.log("[EditModal] init", { startInit, endInit, videoDuration, trimStart, trimEnd });