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
Shery11 opened this issue · 6 comments
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 ?
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.
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.
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.
What do you mean by main button ?
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.
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