Skip to content

Add a playback_ready field to the "/" api response#298

Open
dubeyKartikay wants to merge 2 commits intodevgianlu:masterfrom
dubeyKartikay:add-player-ready
Open

Add a playback_ready field to the "/" api response#298
dubeyKartikay wants to merge 2 commits intodevgianlu:masterfrom
dubeyKartikay:add-player-ready

Conversation

@dubeyKartikay
Copy link
Copy Markdown

@dubeyKartikay dubeyKartikay commented Mar 23, 2026

While trying to test the /player/play endpoint. I ran into a bug where the app would say that "its up" ( GET "/" and "/status" would return 200) but when i hit the /player/play endpoint, the playback would fail.

sometimes the connection id was not set, sometimes the volume sync hadn't happened, which led to the volume of the track changing mid playback.

So i had to expose a playback_ready field that is set to true whenever its safe to call /player/play and false otherwise

fixup
@guidcruncher
Copy link
Copy Markdown

could this be emitted as a event toi?

@dubeyKartikay
Copy link
Copy Markdown
Author

Actually that's a great idea, I'll make the changes

@dubeyKartikay
Copy link
Copy Markdown
Author

Actually, after adding this, and testing for a bit.
i found out that emmiting this as an event is... finiky and not all that reliable.
Here's why :

  1. You probably just started go-librespot, that's why you need to know when its ready for playback
  2. To revieve the playback_ready event, you have to connect to the websocket before the event gets emmited. Otherwise youll miss it.

This kinda makes things unreliable.

@devgianlu what are your thoughts on this?

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.

2 participants