[GH-ISSUE #194] Feature - Create a event to track playback progress #126

Closed
opened 2026-02-28 14:25:36 +03:00 by kerem · 2 comments
Owner

Originally created by @guidcruncher on GitHub (Aug 14, 2025).
Original GitHub issue: https://github.com/devgianlu/go-librespot/issues/194

Feature - Create a event to track playback progress and have it emit an event on the Websocket connection

The event could be something like

progress

  • uri: The Track URI currently being played
  • position: Playback position in milliseconds
  • duration: Playback duration in milliseconds

I guess most ofthe work is still there with the "metadata" event - it just needs to be updated periodically and emitted as this new event

Reason:

There maybe a requirement for some applications to wait for playback progress to be pushed out to them rather than have to "Poll for it" on a regular basis (Say your implementing a playback progress bar) - Pushing out as a websockect event is generally more efficient than polling as you can have multiple clients "Listening" to a Websocket.

Originally created by @guidcruncher on GitHub (Aug 14, 2025). Original GitHub issue: https://github.com/devgianlu/go-librespot/issues/194 Feature - Create a event to track playback progress and have it emit an event on the Websocket connection The event could be something like progress - uri: The Track URI currently being played - position: Playback position in milliseconds - duration: Playback duration in milliseconds I guess most ofthe work is still there with the "metadata" event - it just needs to be updated periodically and emitted as this new event Reason: There maybe a requirement for some applications to wait for playback progress to be pushed out to them rather than have to "Poll for it" on a regular basis (Say your implementing a playback progress bar) - Pushing out as a websockect event is generally more efficient than polling as you can have multiple clients "Listening" to a Websocket.
kerem 2026-02-28 14:25:36 +03:00
Author
Owner

@guidcruncher commented on GitHub (Sep 10, 2025):

I think this could be done locally let me experiment

<!-- gh-comment-id:3276735263 --> @guidcruncher commented on GitHub (Sep 10, 2025): I think this could be done locally let me experiment
Author
Owner

@devgianlu commented on GitHub (Sep 12, 2025):

Yes, generally you can achieve this by keeping the timestamp at which you received the last position update and then do some calculations. That's how Spotify does it.

I am not closing this yet as it might be useful to have a feature where go-librespot pushes periodic updates, but not sure.

<!-- gh-comment-id:3285994751 --> @devgianlu commented on GitHub (Sep 12, 2025): Yes, generally you can achieve this by keeping the timestamp at which you received the last position update and then do some calculations. That's how Spotify does it. I am not closing this yet as it might be useful to have a feature where go-librespot pushes periodic updates, but not sure.
Sign in to join this conversation.
No milestone
No project
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
starred/go-librespot#126
No description provided.