Share browser playback across tabs and fix standard EPUB declarations #2

Merged
conrad merged 4 commits from codex/shared-browser-state into main 2026-09-05 20:49:33 -04:00
Owner

Opening a second Media tab currently blocks the app, and returning to the library stops playback. Tabs now share the persistent local library and one player through a SharedWorker message router. Web Locks guard ownership and detect closed/crashed tabs; observers control the existing player, and a surviving tab can resume at the retained position when the owner closes. Existing OPFS data and pending changes are preserved.

The service-worker media gateway keeps active streams when another tab connects. Resetting local state fences stale requests, wipes through the current host, then reloads peers. Video frames remain in the owning tab. The VFS remains sahpool; docs/browser-tabs.md records the separate opfs-wl binding/data migration target and upgrade behavior.

Also accepts standard XHTML 1.0/1.1 declarations in EPUB files such as Candide, without loading DTDs or expanding custom entities.

Validation: TypeScript and production web build; 513 web tests; 17 reader Rust tests; actual Candide EPUB decoded natively and in browser WASM. Isolated Chrome tests cover two persistent tabs, one audio output, remote controls, owner close and renderer crash, retained position/settings, resets from host and observer, and the actual production bundle booting in two tabs. No server schema change.

Opening a second Media tab currently blocks the app, and returning to the library stops playback. Tabs now share the persistent local library and one player through a SharedWorker message router. Web Locks guard ownership and detect closed/crashed tabs; observers control the existing player, and a surviving tab can resume at the retained position when the owner closes. Existing OPFS data and pending changes are preserved. The service-worker media gateway keeps active streams when another tab connects. Resetting local state fences stale requests, wipes through the current host, then reloads peers. Video frames remain in the owning tab. The VFS remains sahpool; docs/browser-tabs.md records the separate opfs-wl binding/data migration target and upgrade behavior. Also accepts standard XHTML 1.0/1.1 declarations in EPUB files such as Candide, without loading DTDs or expanding custom entities. Validation: TypeScript and production web build; 513 web tests; 17 reader Rust tests; actual Candide EPUB decoded natively and in browser WASM. Isolated Chrome tests cover two persistent tabs, one audio output, remote controls, owner close and renderer crash, retained position/settings, resets from host and observer, and the actual production bundle booting in two tabs. No server schema change.
Subscribe the shared playback host before asynchronous boot
Some checks failed
deploy-fly / deploy (push) Has been cancelled
deploy-fly / validate (push) Has been cancelled
acfcb786d0
conrad merged commit acfcb786d0 into main 2026-09-05 20:49:33 -04:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
conrad/media!2
No description provided.