ghenry22 / cordova-plugin-music-controls2

A Cordova plugin displaying music controls in notifications (cordova-plugin-music-controls)
MIT License
59 stars 60 forks source link

iOS - problem with play/pause and notification #71

Closed MarcinDl closed 1 year ago

MarcinDl commented 3 years ago

Hello,

on iOS I have two quite problems (but with videos only. Fortunately with audios everything is all right):

  1. till the app is minimized, a notification is not visible. When I minimize an app and get back on main screen, a notifications shows up. But why does it not visible on first minimization?
  2. I am able to control previous/next recording, but I can not control play/pause button (please remember, on video only and only from notification). The code I wrote seems to be ok, but from some reason it doesn't work.
updateElapsed({
            elapsed: this.currentTime,
            isPlaying: this.isPlaying
          });

Any suggestions will be appreciate!

Cheers, Marcin

pp8403 commented 3 years ago

Does this plugin work on ios14?

MarcinDl commented 3 years ago

Does this plugin work on ios14?

yes, it works very well. Except play/pause button. 😅

greaterking commented 3 years ago

any one have this working??

ghenry22 commented 3 years ago

Works perfectly on iOS 14 & 15 for me so far but my use case is only for Audio. I haven't tried with Video.

How are you playing the video? With a native plugin of some sort or using HTML5 video tags?

greaterking commented 3 years ago

Yes I was attempting to use music controls while the same time playing the audio through HTML… It seems however that this isn’t possible as far as I can tell. Seems as if you need to use the native Cordova media plug-in in order to make this function correctly. Am I correct in this?

ghenry22 commented 3 years ago

@greaterking yep that's right if you use HTML audio then the browser/webview will override the remote controls plugin. If you use the cordova media plugin then it should work as you expect.

bikubi commented 3 years ago

@ghenry22 does that apply to play/pause controls only, or does this apply to the "notification" (artist/track/album) as well? I.e. when I use HTML audio, can I use the plugin to set a different artist+album, or am I stuck with the default HTML title? (If so: when I use HTML audio, does the plugin do anything?)

ghenry22 commented 1 year ago

@bikubi sorry didn't see this reply, this is woefully late! It basically doesn't work with HTML audio as the metadata will be overriden by the HTML audio's default values.