AudioPlayer icon indicating copy to clipboard operation
AudioPlayer copied to clipboard

Issue with MPNowPlayingInfoCenter

Open dani-mp opened this issue 6 years ago • 0 comments

Hi!

Would it be possible that the updates to the MPNowPlayingInfoCenter made by AudioPlayer are opt-in? I've seen this comment, but with the current implementation I think it's impossible for me to workaround a couple of issues I have in two of my apps that use this library, and I was wondering if other people could be suffering the same problems.

The first issue I have is that I play music radio streams instead of just clips. The implementation is done in a way that once the audio item has already got some metadata, it doesn't get updated anymore, so that means that I can only show the title of the song that is playing when I start the stream, but not the next ones within the same stream/audio item.

The second one, related, is that I don't know beforehand which song is being played, so I don't set any metadata in the audio item. When I get some timed metadata from the stream, I use it to make an API call to my server to retrieve a full object with all the information I want to show in the MPNowPlayingInfoCenter, but this gets in conflict with the data AudioPlayer sets by itself, which is updated when the state of the player changes, for instance.

I think the MPNowPlayingInfoCenter has to do more with view layer of the app, but on the other hand, it's a nice feature to have if it can be updated by itself from the stream's metada, so that's why I would either make it opt-in, or provide a way to update the MPNowPlayingInfoCenter that plays nicely with other parts of the AudioPlayer library.

What do you think?

dani-mp avatar May 29 '18 14:05 dani-mp