From af99c406af8ee47bee38708cf23e86af826e41ba Mon Sep 17 00:00:00 2001 From: metamuffin Date: Sat, 16 Dec 2023 01:08:15 +0100 Subject: watch progress and some draft ui --- web/script/player/mod.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'web/script') diff --git a/web/script/player/mod.ts b/web/script/player/mod.ts index 0d4dc32..85befcc 100644 --- a/web/script/player/mod.ts +++ b/web/script/player/mod.ts @@ -153,10 +153,13 @@ function send_player_progress(node_id: string, player: Player) { const nt = player.video.currentTime if (t != nt) { t = nt - fetch(`/n/${encodeURIComponent(node_id)}/progress?t=${nt}`, { method: "POST" }) + const start = nt < 1 * 60 + const end = nt > player.duration.value - 5 * 60 + + if (!start) fetch(`/n/${encodeURIComponent(node_id)}/progress?t=${nt}`, { method: "POST" }) + if (end) fetch(`/n/${encodeURIComponent(node_id)}/watched?state=true`, { method: "POST" }) } }, 10000) - } function mouse_idle(e: HTMLElement, timeout: number, cb: (b: boolean) => unknown) { -- cgit v1.2.3-70-g09d2