KodarKooperativet / BlackPlayer

BlackPlayer Issue & FAQ
Apache License 2.0
14 stars 0 forks source link

Get playback position from intent #7

Open CartoonPsycho opened 7 years ago

CartoonPsycho commented 7 years ago

Hi, nice work on BlackPlayer, it's a pretty cool and lightweight player.

I'm developing an external application which listens for intents from various music players with actions such as:

I took a look at the extras in the "metachanged"/"playstatechanged" intents which BlackPlayer sends out - turns out that the "position" Integer extra is the position of the current song in the current playlist, I guess? I did browse through all the extras of the intent and didn't find what I was looking for - the current playback position of the track.

Does BlackPlayer broadcast the information I need? If not, would you consider adding another extra (say, "playbackPosition" or whatever) for that purpose?

I am aware that you don't have to conform with any rules as to what to send out because no such standard exists, but this would probably be helpful to people like me developing apps which use music player information.

Thanks in advance, keep up the good work!

KodarKooperativet commented 7 years ago

Hello

This is correct, position is the current queue position. If you want the exact playback position in realtime I suggest you look at the RemoteController instead.

https://developer.android.com/reference/android/media/RemoteController.html

There might be other classes that can handle this, that class was added pretty late (API 19).

Regards