From 109be9a6e6dd6c115ae9fffdc37992a7af1f0236 Mon Sep 17 00:00:00 2001 From: meandaD Date: Fri, 27 Oct 2023 13:43:03 +0200 Subject: [PATCH] #1214 fix progress jumping when parameter t is set to 0 --- web/ts/TUMLiveVjs.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/web/ts/TUMLiveVjs.ts b/web/ts/TUMLiveVjs.ts index 929fa785d..56fd018b4 100644 --- a/web/ts/TUMLiveVjs.ts +++ b/web/ts/TUMLiveVjs.ts @@ -323,11 +323,12 @@ export const watchProgress = function (streamID: number, lastProgress: number) { let iOSReady = false; let intervalMillis = 10000; let jumpTo: number; + let tParam = +getQueryParam("t"); // Fetch the user's video progress from the database and set the time in the player players[j].on("loadedmetadata", () => { duration = players[j].duration(); - jumpTo = +getQueryParam("t") || lastProgress * duration; + jumpTo = isNaN(tParam) ? (lastProgress * duration) : tParam; players[j].currentTime(jumpTo); });