Skip to content

Commit

Permalink
#1214 fix progress jumping when parameter t is set to 0
Browse files Browse the repository at this point in the history
  • Loading branch information
YiranDuan721 committed Oct 27, 2023
1 parent 0a86d4b commit 109be9a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion web/ts/TUMLiveVjs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});

Expand Down

0 comments on commit 109be9a

Please sign in to comment.