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

Pause playback when headphones get unplugged #46

Open
ksiazkowicz opened this issue Oct 8, 2018 · 7 comments
Open

Pause playback when headphones get unplugged #46

ksiazkowicz opened this issue Oct 8, 2018 · 7 comments

Comments

@ksiazkowicz
Copy link
Contributor

When using Librespot locally, user might expect their music to be paused after headphones get unplugged. This is not currently the case.

@wdehoog
Copy link
Collaborator

wdehoog commented Oct 12, 2018

Same goes for disconnecting a bluetooth headset. Is there a DBus event we might listen to?

@wdehoog
Copy link
Collaborator

wdehoog commented Oct 13, 2018

Found a DBus event for headphone. See 80522fe

@abranson
Copy link

I think this is usually done with audio policies.

@wdehoog
Copy link
Collaborator

wdehoog commented Oct 13, 2018

@abranson I don't know much about those policies. I thought they were meant to give access or not. How can we use them to detect disconnection of a headphone or headset to pause playing?

@abranson
Copy link

I will find that out next week - am away this weekend. Other Sailfish music players do it though I think.

@abranson
Copy link

Ok, so it's usually done inside QtMultimedia - the resource is lost and there's a signal to catch. But as you're not using that, the fallback is to listen for the routeChanged like you did in #51.

@wdehoog
Copy link
Collaborator

wdehoog commented Jan 6, 2019

Code is in to pause on route changed to speaker. It works for the audio jack but not for bluetooth. It appears for bluez5 (which my phone uses) you need to run mpris-proxy (from bluez5-tools package) for it to work.

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

No branches or pull requests

3 participants