API for dev?

Report bugs & feature requests for MediaMonkey for Android and learn about the newest beta build.

Moderator: Gurus

Artgeek

API for dev?

Post by Artgeek » Wed Dec 13, 2017 3:21 pm

I'm pretty hyped by MMA features but I'd like to use it with a bluetooth remote controler. I read this page http://www.mediamonkey.com/wiki/index.p ... d_dev_docs and it's pretty tight.
Is it possible for me to add custom actions like using the sleep timer or launch a particular playlist remotely?

If so I could replace my actual audio server (on a raspberry with custom buttons) by MMA, making it movable and much more lighter :) !
Finger crossed

Art'

martin.bohac
Posts: 96
Joined: Thu Nov 14, 2013 5:23 pm

Re: API for dev?

Post by martin.bohac » Tue Dec 19, 2017 7:39 pm

Hi Art,
it's great. I will try to be helpful. I hope I understand your intents.
What kind of Bluetooth remote controller do you have?
To control MMA do you want to implement your own app or somehow map BT keys?

If you are interested to control MMA playback from your app, you can use
https://developer.android.com/reference ... trols.html

example of such app you can find here:
https://github.com/googlesamples/androi ... controller

for browsing MMA content you can use
https://developer.android.com/reference ... ompat.html
(as component use new ComponentName("com.ventismedia.android.mediamonkey", "com.ventismedia.android.mediamonkey.player.PlaybackService"))
I have not found fully implemented source code example of MediaBrowser client, but here is some basic info
https://developer.android.com/guide/top ... serservice

For setup "sleep timer" we have to add special intent for that.
For example
Intent intent = new Intent("com.ventismedia.android.mediamonkey.ACTION_SETUP_SLEEPTIMER");
intent.putExtra("PLAY_AUDIO_FOR_TIME_IN_MINUTES", 15);
sendBroadcast(intent);

Are you satisfied with this?
If you will need to add some other intents, let me know.

Best regards
Martin

Artgeek
Posts: 9
Joined: Thu Dec 28, 2017 2:56 pm

Re: API for dev?

Post by Artgeek » Thu Dec 28, 2017 3:52 pm

Hello Martin,

I didn't see your answer before, thank you very much!
I'd like to use a small remote control like this https://www.amazon.fr/dp/B06XRDWX76/ref ... w=g&hvqmt= I'll check if I can bind my own controls on top of that to send new intents (on "double tap" for example).

This intent is exactly what I had in mind. I would also need to play music from Genres, could it be possible? Like the actual feature to play (with random order) tracks by adding them to the "Now playing list".

I'll give you more explanations on my motives next time (I just wanted to reply quickly to your message today ;) )!

Peke
Posts: 11203
Joined: Tue Jun 10, 2003 7:21 pm
Location: Serbia
Contact:

Re: API for dev?

Post by Peke » Thu Dec 28, 2017 10:08 pm

Hi,
Custom key assignment (like shortcuts in Windows) is not possible ATM in MMA, but as Martin said an app can be made to control MMA.
Best regards,
Pavle
MediaMonkey lead QA/Tech Support guru
Admin of Free MediaMonkey addon Site HappyMonkeying
Image
Image
How to add Images to forum

Post Reply