diff options
Diffstat (limited to 'web/script/player/player.ts')
| -rw-r--r-- | web/script/player/player.ts | 14 | 
1 files changed, 12 insertions, 2 deletions
| diff --git a/web/script/player/player.ts b/web/script/player/player.ts index a92ab4b..ea45e9a 100644 --- a/web/script/player/player.ts +++ b/web/script/player/player.ts @@ -107,9 +107,10 @@ export class Player {              this.set_pers("Downloading track indecies...")              await this.set_track_enabled(0, true, false)              await this.set_track_enabled(1, true, false) -             +              this.set_pers("Downloading initial segments...") -            const start_time = get_continue_time(userdata.watched); +            const start_time = get_query_start_time() ?? get_continue_time(userdata.watched); +              this.update(start_time)              this.video.currentTime = start_time @@ -155,3 +156,12 @@ function get_continue_time(w: WatchedState): number {      if (typeof w == "string") return 0      else return w.progress  } + +function get_query_start_time() { +    const u = new URL(window.location.href) +    const p = u.searchParams.get("t") +    if (!p) return +    const x = parseFloat(p) +    if (Number.isNaN(x)) return +    return x +} | 
