Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

map media control Pause and Resume to PlayerRequests #272

Merged
merged 1 commit into from
Oct 20, 2023

Conversation

SebRollen
Copy link
Contributor

Fixes #271.

Currently, all of MediaControlEvent::{Play, Pause, Toggle} get mapped to PlayerRequest::ResumePause, which means the playback is toggled. In some cases, this means that the media player might send a Pause event, but playback is resumed, because the playback was already paused.

I ran into this issue in #271 where I would disconnect my bluetooth headphones when the playback was already paused, and the player would then resume playback through my computer speakers. Based on the logs, it appears to me that the headphones disconnecting generates a MediaControlEvent::Pause. Instead of resuming the playback, this PR now updates the code to ensure that playback stays paused.

@SebRollen SebRollen force-pushed the create-resume-and-paused-events branch from cc4d079 to 4b30905 Compare October 19, 2023 13:46
@SebRollen SebRollen marked this pull request as ready for review October 19, 2023 13:46
Copy link
Owner

@aome510 aome510 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for taking a look and implementing a fix for the issue!

@aome510 aome510 merged commit 9ba3a03 into aome510:master Oct 20, 2023
4 checks passed
@SebRollen SebRollen deleted the create-resume-and-paused-events branch October 20, 2023 15:40
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.

spotify_player resumes playback on bluetooth headphone disconnect.
2 participants