mirror of
https://github.com/MioMioOS/mio-plugin-music.git
synced 2026-06-11 03:44:31 +00:00
v2.0.4's 15s safety-net poll broke Apple Music latency because macOS 14+
Music.app doesn't reliably broadcast com.apple.Music.playerInfo, and
MediaRemote is 15.4-gated. With no event source actually firing, 15s
between polls = 15s track-change lag.
Poll interval is now computed from stickySource + isPlaying:
- Apple Music playing → 0.8s (no reliable event source)
- Chrome playing → 1.2s (no event source, web audio too)
- Spotify playing → 3.0s (playerInfo broadcast is fast,
poll is just backup)
- MediaRemote playing → 3.0s (MR notifications cover it)
- Idle / nothing playing → 10.0s (NSWorkspace launch observer will
wake us instantly)
rearmPoll() is called after every stickySource change + after the
optimistic isPlaying flip in togglePlayPause, so the cadence adapts
within a single RunLoop tick. Cheap: if the new interval equals the
current one within 0.01s, skip the Timer re-alloc.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
||
|---|---|---|
| .. | ||
| sources | ||
| support | ||
| ui | ||
| MioPlugin.swift | ||
| MusicPlugin.swift | ||
| NowPlayingState.swift | ||