Commit Graph
8 Commits
Author SHA1 Message Date
Philipp Grafe 72c7d4dff4 media_player: handle STOP command correctly (fixes #128)
Home Assistant sends MEDIA_PLAYER_COMMAND_STOP when the queue is cleared.
The MediaPlayer entity did not handle this command, causing playback to
continue without media metadata and leaving the UI in an inconsistent state.

This change adds explicit handling for the STOP command:
- stop playback via the music player
- reset the media player state to IDLE

This aligns the behavior with the original player and Home Assistant’s
expected media player semantics.
2026-02-10 18:58:55 +01:00
Philipp Grafe b2d4ec1413 Fix mpv pause state when loading new media
Prevent IDLE state and done callback on track replacement

mpv emits an end-file event when playback is stopped. During track
replacement this caused the media player to transition to IDLE and
notify Home Assistant even though a new track was already playing.

Introduce a suppression flag to distinguish track replacement from
natural playback end and avoid incorrect state transitions.
2026-02-10 14:27:22 +01:00
Philipp Grafe 3e893ab44b Fix mpv pause state when loading new media
- added some debug logging
2026-02-09 11:41:40 +01:00
Philipp Grafe f5b76b8921 TTS does not lower mpv music volume while speaking
- Fixes #126
- callback was missing
2026-02-08 18:29:40 +01:00
Philipp Grafe 9b52f61a9f Fix mpv pause state when loading new media
- unduck() does not seem to be fired bei VA? Doing unduck() in new playback and resume.
2026-02-08 11:29:45 +01:00
Philipp Grafe 5541303d1d Fix mpv pause state when loading new media
- Cleanup and Docstring
2026-02-08 11:00:40 +01:00
Philipp Grafe e4c26a323e Fix mpv pause state when loading new media
- Bugfix for volume setting
- Making duck() unduck() stable
2026-02-08 10:59:56 +01:00
Philipp Grafe d42abaa2c9 Fix mpv pause state when loading new media
Fixes #107

This fixes an issue where loading a new media URL while the player
was paused would keep playback paused, causing Music Assistant to
show the player as playing while no audio was audible.

The mpv pause state is now always set explicitly when starting playback,
ensuring deterministic behavior
2026-02-03 21:34:57 +01:00