diff options
author | metamuffin <metamuffin@disroot.org> | 2023-12-16 01:08:15 +0100 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2023-12-16 01:08:15 +0100 |
commit | af99c406af8ee47bee38708cf23e86af826e41ba (patch) | |
tree | 23498a36f813454c2edea46906f812d929ba792e /web/script | |
parent | 21b58037c69798e922c5512ea5380943781558ff (diff) | |
download | jellything-af99c406af8ee47bee38708cf23e86af826e41ba.tar jellything-af99c406af8ee47bee38708cf23e86af826e41ba.tar.bz2 jellything-af99c406af8ee47bee38708cf23e86af826e41ba.tar.zst |
watch progress and some draft ui
Diffstat (limited to 'web/script')
-rw-r--r-- | web/script/player/mod.ts | 7 |
1 files changed, 5 insertions, 2 deletions
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) { |