Skip to content

feat(player): show YouTube chapters next to lyrics - #72

Open
mihaimetal wants to merge 2 commits into
NUber-dev:mainfrom
mihaimetal:feature/chapters
Open

mihaimetal wants to merge 2 commits into
NUber-dev:mainfrom
mihaimetal:feature/chapters

Conversation

@mihaimetal

@mihaimetal mihaimetal commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Extract PlayerMediaPanel so the side player and the bottom-bar lyrics popover render the same surface (this used to be feat(player): share one lyrics panel across player layouts #71).
  • Fetch YouTube chapters from the anonymous WEB /player (official chapterRenderer / markersMap first, then the description timestamp list YouTube itself promotes to chapters).
  • When a track has at least two chapters, the panel grows Lyrics / Chapters tabs and defaults to Chapters. Clicking a row seeks.
  • Persist the tiny chapter lists so OSTs reopen instantly.
  • formatTime now supports hour-long timestamps (1:31:29) via a shared formatTimestamp.

Why

OST dumps, long mixes, and uploaded concerts already have clickable chapter lists on YouTube. YT Music's WEB_REMIX /next and /player do not carry them (verified against a 152-chapter OST), so this uses the regular YouTube WEB client, unsigned — same rationale as YTM lyrics.

The shared panel is in the same PR because chapters hang Lyrics / Chapters tabs on it. Splitting that extract out as #71 made the stack noisier than the change is worth.

Scope

Frontend-only, rebased cleanly on v0.4.4 / current origin/main. One branch: feature/chapters (2 commits).

Test plan

  • pnpm test (includes chapters.test.ts + format.test.ts)
  • tsc --noEmit
  • Side player: lyrics still flow under the cover; source picker still in the bottom row
  • Bottom-bar lyrics popover: title + source picker + lyrics body
  • Play a chaptered OST (e.g. a game soundtrack upload with a 0:00 track list) — Chapters tab appears and is selected
  • Click a chapter — playback seeks; the active row tracks the playhead / scrubber
  • Play a normal song with no chapters — panel is still just lyrics, no tabs
  • Replay the same OST after a restart — Chapters tab appears immediately from cache
  • Side player and bottom-bar popover both show the same tabs

Notes

Supersedes #71. Independent of the macOS / WEB_REMIX / speed / Share (#73) PRs. No cookies are sent to www.youtube.com.

Extract PlayerMediaPanel so the side player and the bottom-bar
popover render the same lyrics surface, including the source picker
header on the popover.
Fetch chapters from the anonymous WEB /player (official markers, then
description timestamps). When a track has them, the lyrics panel
gains Lyrics / Chapters tabs and defaults to Chapters. Clicking a
row seeks. Persist the tiny lists so OSTs reopen instantly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant