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

Plugin is responding to headphones buttons but when i press the volume up and volume down button. It would only increase the device volume but doesn't fire an event #143

Open
Shery11 opened this issue Nov 23, 2018 · 6 comments

Comments

@Shery11
Copy link

Shery11 commented Nov 23, 2018

I am trying to develop an app where when i press the input volume up button on headphone it handles the event and do something in the app but the headset buttons are not firing any event.

Any idea why is this happening ?

@Shery11 Shery11 changed the title Plugin is not responding to headset buttons. Pause next previous in ionic 3. Plugin is responding to headphones buttons but when i press the volume up and volume down button. It would only increase the device volume but doesn't fire an event Nov 24, 2018
@Shery11
Copy link
Author

Shery11 commented Nov 24, 2018

Updated. Managed to solve the issue but now when press the volume buttons then it would not fire event rather than that it would increase the device volume.

@ghenry22
Copy link
Contributor

ghenry22 commented Dec 26, 2018

Check the readme, some buttons only fire events on certain operating systems. iOS doesn’t fire volume events and will only change device volume. This is an iOS limitation.

Android should fire volume change events and change the media volume.

@javier-gm
Copy link

Updated. Managed to solve the issue but now when press the volume buttons then it would not fire event rather than that it would increase the device volume.

Hi! I know it's been a while but how did you managed to make it work in Ionic3. I can't get the events from headphones. I only need the main button.

@Shery11
Copy link
Author

Shery11 commented Aug 20, 2019

What do you mean by main button ?

@javier-gm
Copy link

Sorry if I explained myself wrong. Headphones usually have 3 buttons: vol+, vol- and the one you use to play/pause. I don't know its name. My app recognize when I plug/unplug the headphones, but none of the buttons.

@Shery11
Copy link
Author

Shery11 commented Aug 20, 2019

As far as i remember i was actually not able to get the middle button working but was able to get vol+ and vol- button by listening for cordova events

please refer to this https://cordova.apache.org/docs/en/latest/cordova/events/events.html#volumedownbutton

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