From 1e239240a072a14a1af41785477946435eaf2101 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Sun, 22 Oct 2023 15:34:56 +0200 Subject: dont show buffering on video end --- web/script/player/player.ts | 1 + web/script/transition.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'web/script') diff --git a/web/script/player/player.ts b/web/script/player/player.ts index 4c1d9fc..062ad59 100644 --- a/web/script/player/player.ts +++ b/web/script/player/player.ts @@ -38,6 +38,7 @@ export class Player { } this.video.onwaiting = () => { console.log("waiting"); + if (this.video.currentTime > this.duration.value - 0.2) return this.set_pers("Playback finished") this.set_pers("Buffering...") this.canplay.value = false; } diff --git a/web/script/transition.ts b/web/script/transition.ts index 00ed9a7..e0ee6f5 100644 --- a/web/script/transition.ts +++ b/web/script/transition.ts @@ -36,7 +36,6 @@ async function transition_to(href: string, back?: boolean) { await fade(false) trigger_load() disable_transition = false; - await fade(true) } function show_error(mesg: string) { @@ -60,6 +59,7 @@ function prepare_load(href: string, back?: boolean) { document.head.innerHTML = head document.body.outerHTML = body globalThis.dispatchEvent(new Event("DOMContentLoaded")) + fade(true) } } -- cgit v1.2.3-70-g09d2