[PR #1495] [MERGED] Send playback position as player event #1418

Closed
opened 2026-02-27 20:02:22 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/librespot-org/librespot/pull/1495
Author: @fragsalat
Created: 4/28/2025
Status: Merged
Merged: 5/3/2025
Merged by: @photovoltex

Base: devHead: dev


📝 Commits (7)

  • 84c6849 Send play progress as PlayerEvent::PositionChanged
  • f26e3de Replaced PlayerEvent::PositionChanged with set_progress_callback() method
  • e8b3652 Revert "Replaced PlayerEvent::PositionChanged with set_progress_callback() method"
  • af8372a Added opt-in config in PlayerConfig for progress event
  • 9119a06 Added doc comments and set default position interval to 1sec for standalone
  • 7e6290c Remove handling of PositionChanged in standalone binary
  • b1a789b Fixed wrong event handling

📊 Changes

5 files changed (+34 additions, -0 deletions)

View changed files

📝 CHANGELOG.md (+1 -0)
📝 playback/src/config.rs (+4 -0)
📝 playback/src/player.rs (+26 -0)
📝 src/main.rs (+1 -0)
📝 src/player_event_handler.rs (+2 -0)

📄 Description

Fixing #1493

Hey there, I did an example implementation how the playback position could be sent to the user of the Player struct.
The change should be backward compatible and I did throttle the sending of events by only informing every 250ms.
Please tell me in case you prefer a different solution or would like to change something else.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/librespot-org/librespot/pull/1495 **Author:** [@fragsalat](https://github.com/fragsalat) **Created:** 4/28/2025 **Status:** ✅ Merged **Merged:** 5/3/2025 **Merged by:** [@photovoltex](https://github.com/photovoltex) **Base:** `dev` ← **Head:** `dev` --- ### 📝 Commits (7) - [`84c6849`](https://github.com/librespot-org/librespot/commit/84c68497aa40afabb50812ea43a079e61610128f) Send play progress as PlayerEvent::PositionChanged - [`f26e3de`](https://github.com/librespot-org/librespot/commit/f26e3de07b667fd764416a79ae682882063e0688) Replaced PlayerEvent::PositionChanged with set_progress_callback() method - [`e8b3652`](https://github.com/librespot-org/librespot/commit/e8b3652dfa22676441b2073b99e383d2f07c3578) Revert "Replaced PlayerEvent::PositionChanged with set_progress_callback() method" - [`af8372a`](https://github.com/librespot-org/librespot/commit/af8372a26f973835a36bae600220fc37a4d19c0f) Added opt-in config in PlayerConfig for progress event - [`9119a06`](https://github.com/librespot-org/librespot/commit/9119a063509727882cf69159e34f2e06a1e65a46) Added doc comments and set default position interval to 1sec for standalone - [`7e6290c`](https://github.com/librespot-org/librespot/commit/7e6290c65b299ff16b1f8c7b41ba56ac15a05e05) Remove handling of PositionChanged in standalone binary - [`b1a789b`](https://github.com/librespot-org/librespot/commit/b1a789b94ac1f27371ebe5e7bba16c440b98172d) Fixed wrong event handling ### 📊 Changes **5 files changed** (+34 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+1 -0) 📝 `playback/src/config.rs` (+4 -0) 📝 `playback/src/player.rs` (+26 -0) 📝 `src/main.rs` (+1 -0) 📝 `src/player_event_handler.rs` (+2 -0) </details> ### 📄 Description Fixing #1493 Hey there, I did an example implementation how the playback position could be sent to the user of the Player struct. The change should be backward compatible and I did throttle the sending of events by only informing every 250ms. Please tell me in case you prefer a different solution or would like to change something else. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 20:02:22 +03:00
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/librespot#1418
No description provided.