Giter Club home page Giter Club logo

Comments (9)

neoassyrian avatar neoassyrian commented on September 25, 2024

I totally agree with this. Need to see this feature.

from cordova-music-controls-plugin.

homerours avatar homerours commented on September 25, 2024

Sorry for the delay.
I also agree with you. I'll look at this. However, I have nothing to do tests with that...
So you would like that the callback gives you the integer event.getKeyCode() (the significations of the integers are given here) ?
The best way to do it would be, as you said, to add a second integer parameter to the callback function. However, it would requires to do lots of changes (and I don't have the competences to do it for iOS and windows...).

So I can propose you a "temporary fix". I can add a switch here which will distinguish between the most relevant values of the keyCode. In our case of music-control plugin, that would typically be play/pause prev/next, volume up/down ... The new message return would be then of the form "music-controls-media-button-play".
Does it look ok for you ?
If yes, I create a new branch for you to test it ;)

from cordova-music-controls-plugin.

nettiteeri avatar nettiteeri commented on September 25, 2024

Thank you for looking into it.
Yes I can test it for you.

from cordova-music-controls-plugin.

homerours avatar homerours commented on September 25, 2024

I just created a new branch.
It handles the most common (I guess) keyEvents, see here.
Can you give a try and tell me if the event created by your remote are working ? Thank you.

from cordova-music-controls-plugin.

nettiteeri avatar nettiteeri commented on September 25, 2024

Did a quick test with the new branch.
Play, pause, prev and next buttons worked in my car. Didn't have other buttons to test.

Also, seemed to still work with a basic wired headphones pause button.

The car computer also likes to show album, track name and current position. Haven't researched how one would go about updating those. Now seems to pick the last played track name from other applications.

from cordova-music-controls-plugin.

neoassyrian avatar neoassyrian commented on September 25, 2024

Hi guys,
I would like to test this too. However, I'm using Ionic2 Native. Will this be added to the Ionic2 Native github too?

from cordova-music-controls-plugin.

homerours avatar homerours commented on September 25, 2024

Hi,
I do not know how the ionic team update their "wrappers" for Cordova plugins, so I guess that you'll have to wait. Can you test the plugin "outside" of ionic native ?

@Corrodian : great ! I'll see if I can add some more events...

from cordova-music-controls-plugin.

neoassyrian avatar neoassyrian commented on September 25, 2024

Tested it and it works in the car. Not working on my headsets though. I tested it on an Android phone.
There is also no need to update the ionic native wrapper, because it is using the same existing method.

from cordova-music-controls-plugin.

homerours avatar homerours commented on September 25, 2024

Ok good. I merged it to the master branch. I also add some more keycodes: your headset button may be recognized now. All keycodes are listed here. I added the most relevant. If you have suggestions about other keycodes, I can add them !

For the moment, when you press "next" or "previous" on your headset, you only get a "music-controls-media-button" message right ?

from cordova-music-controls-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.