Add in-browser episode player with playback-position sync#98
Open
debenore wants to merge 1 commit into
Open
Conversation
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.
d85a5d6 to
22fc2f0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
POST /api/2/episodes/current.jsonendpoint, sending standard gPodderplayactions — no new endpoint or auth (uses the web session cookie).sendBeacon), and every 20s while playing, so progress round-trips with AntennaPod, Kasts, etc.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 barserver/style.css— player stylingNotes
Tested end-to-end: cookie authorises the POST; position stores and reads back via the episodes API.