Skip to content

feat(dock): route enclosures through the shared engine picker - #155

Merged
ralyodio merged 3 commits into
mainfrom
shared-player
Aug 29, 2026
Merged

feat(dock): route enclosures through the shared engine picker#155
ralyodio merged 3 commits into
mainfrom
shared-player

Conversation

@ralyodio

Copy link
Copy Markdown
Contributor

Adopts @profullstack/player — its delivery half only.

What changes

The dock's <video> and <audio> lose their src attribute; an effect attaches the source instead.

The dock set src={track.src} and hoped. That is right until an enclosure is something a browser cannot open by itself — and this directory is a crawl of the open web, so what turns up in an enclosure is whatever the publisher chose. An HLS playlist handed straight to a <video> plays nothing and reports a bare media error, which reads as a broken episode rather than a missing library.

attachSource names the source and picks the delivery: native for the ordinary MP3 or MP4, hls.js for a playlist.

What does not change

The queue, the remembered position, the popout, surviving a soft navigation, the up-next list. This adopts the delivery half only — swapping in the package's control bar would mean deleting a 916-line queue-aware dock to gain a nicer-looking one.

Embeds are skipped: a YouTube or PeerTube track is an <iframe> with no media element to attach to.

Not done, deliberately

EpisodePlayer.jsx keeps its static src. It is a server component, so attaching a client-side engine there means making it a client one — a bigger change than this. Its own comment already says "no browser recognises HLS's [source type], so a live channel announced that way never starts", which is the same gap on the secondary surface. Worth a follow-up.

Checks

next build clean (18 routes), npm test green across the workspace. Note pnpm added @profullstack/player@0.2.0 to minimumReleaseAgeExclude — pnpm 11 gates freshly-published packages and this one is minutes old.

🤖 Generated with Claude Code

https://claude.ai/code/session_01WFLwZtXE6iBJyJSgrsWqRM

ralyodio and others added 3 commits August 18, 2026 09:31
A post on c0mpute.com would not load in the reader. Nothing was wrong with it:
the page answered 200 to every request I made. What had happened is that the
reader probed it once, that one request got a 500, and the failure was cached
for twenty-four hours — so the post stayed broken long after the origin was
fine again.

Measured against the live site: one 500 in ninety-nine requests. Not a cold
start (the first request after 60, 120 and 180 seconds idle was fine) and not
load (forty parallel requests were fine). Just an occasional error, of the kind
every origin has. A one-per-cent event was costing a full day of downtime for
that post, which is the wrong order of magnitude by about three.

The cache itself is right — without it every view of a paywalled post is another
request to the publisher — but it had one number for two different situations.
A paywall will still be a paywall tomorrow. A 500 is the server telling us it
failed, and a network error is us never having heard from it at all; both are
worth asking again shortly.

So transient failures now retry after ten minutes and everything else keeps the
day. The distinction is drawn on the response rather than on any opinion about
the site: 5xx and fetch errors are transient, 4xx is an answer, `blocked-host`
is a refusal we made ourselves, and `empty` is a paywall or a JavaScript-only
page that will parse to nothing at teatime too.

Ten minutes is long enough that a genuinely broken origin is not hammered once
per viewer, and short enough that nobody files a bug about it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The dock set `src={track.src}` on its <video> and its <audio> and hoped. That
is right until an enclosure is something a browser cannot open by itself, and
this directory is a crawl of the open web -- what turns up in an enclosure is
whatever the publisher chose. An HLS playlist handed straight to a <video>
plays nothing and reports a bare media error, which reads as a broken episode
rather than a missing library.

`attachSource` from @profullstack/player names the source and picks how to
deliver it: native for the ordinary MP3 or MP4, hls.js for a playlist.

Nothing else changes. The queue, the position it remembers, the popout,
surviving a soft navigation, the up-next list -- all untouched. This adopts
the package's delivery half only, not its control bar: swapping the bar would
mean deleting a 916-line queue-aware dock to gain a nicer-looking one.

Embeds are skipped, since a YouTube or PeerTube track is an <iframe> with no
media element to attach to. The effect guards a race the attribute could not
have: attaching is asynchronous, because an engine is only downloaded when a
source needs one, so a fast walk through a playlist would otherwise leave an
earlier attachment running under a later one.

EpisodePlayer keeps its static src for now -- it is a server component, so
attaching a client-side engine there is a larger change than this one. Its
comment already notes that no browser recognises HLS's source type, which is
the same gap, on the secondary surface.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WFLwZtXE6iBJyJSgrsWqRM
The branch went conflicting: main moved and pnpm-lock.yaml cannot be merged
textually. Two lockfiles merged line by line produce duplicate YAML keys,
which pnpm writes happily and then refuses to read -- the same failure that
had media-streamer's CI unable to install anything.

So the lockfile is taken from main and regenerated rather than resolved by
hand, and pnpm-workspace.yaml likewise, which also keeps main's msgpackr-extract
decision intact.

Pinned at 0.3.1 so all the adopting repos are on one version.

next build clean, workspace tests green.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WFLwZtXE6iBJyJSgrsWqRM
@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Added@​profullstack/​player@​0.3.17710010088100

View full report

@ralyodio
ralyodio merged commit 1c4c3ab into main Aug 29, 2026
3 checks passed
@ralyodio
ralyodio deleted the shared-player branch August 29, 2026 08:47
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