Skip to content

feat: support media controller on mac#172

Merged
bjarneo merged 6 commits intobjarneo:mainfrom
gjermundgaraba:feat/mac-mediactl-option-1
Apr 7, 2026
Merged

feat: support media controller on mac#172
bjarneo merged 6 commits intobjarneo:mainfrom
gjermundgaraba:feat/mac-mediactl-option-1

Conversation

@gjermundgaraba
Copy link
Copy Markdown
Contributor

@gjermundgaraba gjermundgaraba commented Apr 6, 2026

This is an alternative to #171 that takes a slightly broader approach. Instead of adding macOS support via a registry/init() pattern on top of the existing mpris package, this PR consolidates platform media control into a single mediactl package with explicit wiring.
The mpris code is moved rather than wrapped, dead aliases are removed, and a internal/playback domain layer is introduced so seek/position values use time.Duration throughout instead of raw microseconds.
The trade-off is a larger diff, but it eliminates the side-effect import pattern and gives both platforms a clean shared contract.

Side-note: a neat follow-up to this that I am planning is to also get the song/album art showing in the native media controller.

  • Add macOS media key support (play/pause/next/prev/seek via Control Centre, Touch Bar, Bluetooth headphones)
  • Consolidate MPRIS and macOS backends into a unified mediactl package, replacing the separate mpris package
  • Introduce internal/playback domain types using time.Duration instead of raw microseconds
  • Use explicit wiring instead of init()-based registry pattern
  • Add tests for volume conversion, IPC seek, notifier attachment, and darwin service
image

Closes #70

@gjermundgaraba gjermundgaraba mentioned this pull request Apr 6, 2026
@bjarneo
Copy link
Copy Markdown
Owner

bjarneo commented Apr 6, 2026

I think I like your approach better than mine. I'll spin it up on my mac and give it a go.

@bjarneo
Copy link
Copy Markdown
Owner

bjarneo commented Apr 7, 2026

Works well!

@bjarneo bjarneo merged commit 9a78b3e into bjarneo:main Apr 7, 2026
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.

Media keys for Mac

2 participants