Comments (9)
I totally agree with this. Need to see this feature.
from cordova-music-controls-plugin.
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.
Thank you for looking into it.
Yes I can test it for you.
from cordova-music-controls-plugin.
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.
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.
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.
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.
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.
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)
- Not running HOT 2
- Music control external controls stop working
- updateIsPlaying won't work and ios controls continuously pops up as "playing" HOT 1
- Plugin didn't work on iOS 11.4 HOT 5
- 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 HOT 6
- Ionic 4 cordova-plugin-music-controls breaks build HOT 14
- Ionic Webview 2.4.0 removes WKSuspendInBackground HOT 2
- Not being able to include in new projects HOT 1
- Build failed: Task :app:compileDebugJavaWithJavac FAILED HOT 15
- Run in Background HOT 13
- iOS - Invalid Callback ID HOT 8
- iOS does not work HOT 5
- Music controls don't work HOT 2
- Ionic - Issue installation
- The song is constantly stuck! Need help! HOT 2
- Plugin crashes on iOS 13 HOT 12
- Controls are not firing HOT 2
- musicControl.destroy doesnt close the control in IOS HOT 2
- Does not work on iOS; HOT 9
- User kill app, notification not. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cordova-music-controls-plugin.