fix(controlcenter): refresh player state on resume
When control center hides, PlayerBox.suspend() blocks all signal handlers. On resume(), clearing the flag wasn't enough — stale state lingered until next fabricator poll (up to 5s). Now resume() immediately syncs play/pause icon, metadata, and artwork.
This commit is contained in:
1 file changed
+10
@@ -570,6 +570,16 @@ class PlayerBox(Box):
|
|||||||
|
|
||||||
def resume(self):
|
def resume(self):
|
||||||
self.exit = False
|
self.exit = False
|
||||||
|
if self.player is not None:
|
||||||
|
current_status = str(self.player.playback_status).lower()
|
||||||
|
self._last_notified_status = current_status
|
||||||
|
self.play_pause_icon.dynamic_file(
|
||||||
|
"player/play.svg"
|
||||||
|
if current_status == "paused"
|
||||||
|
else "player/pause.svg"
|
||||||
|
)
|
||||||
|
self._on_metadata(self.player, self.player._player.props.metadata)
|
||||||
|
self.set_image()
|
||||||
|
|
||||||
def _on_map(self, *_):
|
def _on_map(self, *_):
|
||||||
self._check_and_update_playing_state()
|
self._check_and_update_playing_state()
|
||||||
|
|||||||
Reference in new issue
Block a user