Repository navigation
Ignore Windows pause commands so they can't stop the office speakers - #110
Merged
Merged
Conversation
The mic-in-use check from #109 didn't stop the pauses: Bluetooth headsets send pause when they connect, switch to call mode or come off, which doesn't line up with the mic opening. Windows can't tell those apart from a deliberate media-key pause, so pause commands from SMTC and Chromium's media session are now ignored on Windows. Play, next and previous still work, and pausing from the app and its taskbar buttons is unchanged. Removes the now-unused mic-in-use module. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Coverage Report
File Coverage
|
||||||||||||||||||||||||||||||||||||||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
#109 tried to tell Teams' automatic pause apart from a real one by checking whether the mic was open. It still pauses: on the first test call after updating to 1.0.48, no
SmtcPauseIgnoredevent was logged, so the pause didn't arrive while the mic was open. The likely cause is Bluetooth headsets, which send pause when they connect, switch into call mode, turn off or are taken off. Windows passes those on exactly like a media-key press, so there's no way to filter them.Fix
On Windows, pause commands from the OS no longer reach Sonos:
main.ts): thepauseaction is ignored and logged (SmtcPauseIgnoredtelemetry event).useMediaSession.ts): thepausehandler does nothing on Windows. It's a no-op rather thannullso Chromium doesn't apply its own default.Still works from Windows: play, next, previous. Pausing from the app's player controls and the taskbar thumbnail buttons is unchanged. macOS keeps its existing media-session pause behaviour.
The pause button in the Windows media flyout is still shown but does nothing. Hiding it would need a native addon change.
Removes the now-unused
mic-in-usemodule from #109.Testing
npm run typecheck,npm run test:runand ESLint pass.🤖 Generated with Claude Code