Open johnthepink opened 8 years ago
Thanks for the plugin. I have the same problem too. I use it on a ionic project with cordova-media-player. Please help. Thanks.
@HrBayat are you using the WKWebview, or the standard WebView? Did you manage to get this working?
I ran into the same problem.
In the MNowPlaying.m file after this: NSMutableDictionary *mediaDict = (center.nowPlayingInfo != nil) ? [[NSMutableDictionary alloc] initWithDictionary: center.nowPlayingInfo] : [NSMutableDictionary dictionary];
add this new line : [[UIApplication sharedApplication] beginReceivingRemoteControlEvents];
Haven't tested on simulator just on iPhone width media plugin (cordoba-plugin-media).
I suggest this settings as well:
If you like the plugin please don't forget to donate leon who made it :) buy a coffee to him :D
Interestingly enough @holospeed 's fix worked on Ionic 2 from about a week ago but stopped as of this current release. Any news on this issue?
trying with cordova v 6.3.1. not working unfortunately. any hints? did anyone else encounter these problems lately?
EDIT: I think it may be because of iOS 10. @leon is there any chance that the plugin should be update for iOS 10?
What's weird is this was working (if a little finicky) on the iOS 10 betas. Works perfectly in simulator, works not at all on the device.
I made a working example. I hope it will help :) tested on iPhone 6s. https://github.com/holospeed/nowplaying
Which version of iOS did you test because in iOS10 the plugin doesn't do what it is supposed to do I'm afraid. Or the following must be wrong:
NowPlaying.set({
artwork: logo,
albumTitle: nice_name,
artist: nice_name,
composer: nice_name,
genre: 'Hardstyle'
});
Of course the values are set. I have tried different plugins that promise to work, but don't :(
@vespino you can try this one: https://www.npmjs.com/package/cordova-plugin-remotecmd-playinginfo. it works on the simulator, but not on the actual device, though :( if you find a way to make it work (this one or any other one), please let me know also :D
@daniavram if it doesn't work on an actual device, why would I try it?
@holospeed That doesn't seem to work on iOS 10/10.1 still.
I think if you're using WKWebView (which is now standard practice in cordova-ios >= 4.0?) you're not going to be able to override the lock screen Now Playing Info while html5 audio is playing in WKWebView. Maybe switch to cordova-media instead of HTML5 audio if possible
@clnhll Don't think so. I'm using cordova-media and as mentioned above it does indeed work in the emulator but not on-device.
Is using UIWebView an option?
@clnhll tried UIWebView, atleast I removed "cordova-plugin-wkwebview-engine" from my project, did not work.
It works for me in Simulator but not on a device. All capabilities are set correct, the fix as holospeed suggested does not work. What are we missing?
Hey! Thanks for the great plugin. I wonder if you can point me in the right direction.
I have created a simple cordova project that implements this plugin here: https://github.com/johnthepink/testnowplaying
I use
NowPlaying
to set some data here: https://github.com/johnthepink/testnowplaying/blob/master/www/js/index.js#L37-L41This works great in the simulator:
But when I run the same project on my device, it doesn't seem to work:
Do you have any ideas on why this would happen? I installed the plugin from the latest source on github. And, I tried linking
MediaPlayer.framework
.Thanks!