diff options
Diffstat (limited to 'web/script/player/mod.ts')
-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) { |