Phone follows a live Playback Session and shows its Playhead #3
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
mobrule/kurageyomi#3
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Parent
#1 — PRD: Kurageyomi
What to build
The phone follows a live Playback Session and displays its Playhead.
Add a
SessionWatcherthat resolves which Playback Sessions belong to the requesting user andexposes each one's Playhead, item, and stream indices. The page subscribes to session state and
shows the Playhead updating as an episode plays. Raw ticks on screen is a perfectly good demo
for this slice — no Cues yet.
Selection behaviour: exactly one playing Playback Session is followed automatically; more than
one shows a picker; whichever was picked is remembered for next time.
Note the cadence this has to live with, because it shapes everything downstream. Clients report
progress on a 10-second throttle while playing, but report immediately on pause,
unpause, and any seek beyond roughly 5 seconds of drift. The server does not extrapolate — the
Playhead it reports is simply the last value a client sent. Subscribing to the server's session
push more often than every 10 seconds does not get fresher numbers; it gets the same number
repeated, and fast notification of pause and seek. Do not paper over this here by interpolating
— that is #5's job, and it needs the raw reports to be visibly raw.
Acceptance criteria
Blocked by
Implemented and merged to
mainatc8440ee. Held open deliberately: the code is unit-tested but has never run on the real server, and this issue's criteria include behaviour only observable there. #6 deploys it; this closes once that confirms it.Verified on dionysus: sign-in works from the phone, the playing Playback Session is followed with no interaction, and its Playhead updates. Merged in
main.One deployment-time fix this needed:
crypto.randomUUIDis undefined outside a secure context, so device id generation crashed sign-in over http. Device ids now come fromcrypto.getRandomValues, with tests.Follow-up filed as #7 — pause and unpause lag by up to a poll interval, which the session WebSocket removes.