Skip to content

fix(playback): sync play/pause button with media keys#43

Open
mihaimetal wants to merge 1 commit into
NUber-dev:mainfrom
mihaimetal:fix/media-key-play-pause-ui
Open

fix(playback): sync play/pause button with media keys#43
mihaimetal wants to merge 1 commit into
NUber-dev:mainfrom
mihaimetal:fix/media-key-play-pause-ui

Conversation

@mihaimetal

Copy link
Copy Markdown

Summary

  • Keep the player play/pause icon in sync when OS media keys (e.g. macOS F8) toggle playback.
  • On macOS, hardware media keys often pause/resume the WebKit <audio> element directly instead of going through the souvlaki media-control path, so sound changed but the store’s playing flag (and thus the button) did not.
  • Mirror element play / pause events into the playback store.
  • Briefly suppress that sync during intentional track-switch pauses so auto-advance still keeps playing: true.

Test plan

  • Play a track, press F8 (media play/pause) — audio pauses and the player button switches to Play
  • Press F8 again — audio resumes and the button switches to Pause
  • In-app play/pause button and Space still work
  • Skipping tracks still auto-resumes without the button flipping to Play mid-switch
  • macOS release build smoke-tested

Notes

Independent of the WEB_REMIX / auth / packaging PRs; can merge on its own against main.

macOS media keys (F8) often toggle the WebKit <audio> element directly
without going through our store. Mirror element play/pause events into
playing so the UI icon stays correct, and suppress that sync briefly
during intentional track-switch pauses.
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.

1 participant