Skip to content

Add in-browser episode player with playback-position sync#98

Open
debenore wants to merge 1 commit into
kd2org:mainfrom
debenore:feature/in-browser-player
Open

Add in-browser episode player with playback-position sync#98
debenore wants to merge 1 commit into
kd2org:mainfrom
debenore:feature/in-browser-player

Conversation

@debenore

Copy link
Copy Markdown

What

An optional sticky audio player on the feed page: click an episode to stream it in the browser, with playback position synced back to the server.

How

  • Reuses the existing POST /api/2/episodes/current.json endpoint, sending standard gPodder play actions — no new endpoint or auth (uses the web session cookie).
  • Auto-resumes from the last synced position; reports on pause/seek/end, page unload (sendBeacon), and every 20s while playing, so progress round-trips with AntennaPod, Kasts, etc.
  • Vanilla JS (server/player.js), no dependencies. Audio streams direct from the host; http:// or hot-link-protected episodes show a status message rather than failing silently.

Files

  • server/player.js (new)
  • server/templates/feed.tpl — play buttons + player bar
  • server/style.css — player styling

Notes

  • Feeds with per-client media URLs (trackers) won't cross-sync position for those episodes — same caveat as existing action titles.
  • No CSRF protection on cookie-auth writes (pre-existing, repo-wide). Happy to follow up with a separate PR.

Tested end-to-end: cookie authorises the POST; position stores and reads back via the episodes API.

Adds an optional sticky audio player to the feed page. Clicking an episode
streams its audio in the browser and reports playback position back to the
existing /api/2/episodes/current.json endpoint as gPodder "play" actions,
authenticated by the current web session cookie -- no new endpoint or auth.

- Auto-resumes each episode from the last synced position (read from the
  action log already loaded by feed.php).
- Reports on pause, seek, end, page unload (sendBeacon) and every 20s while
  playing, so progress round-trips with other gPodder clients (AntennaPod,
  Kasts, etc.).
- Pure vanilla JS (server/player.js), no dependencies or build step.
- Degrades gracefully: episodes over http:// (mixed content) or from
  hot-link-protected hosts show a short status message instead of failing
  silently.
@debenore debenore force-pushed the feature/in-browser-player branch from d85a5d6 to 22fc2f0 Compare June 13, 2026 18:01
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