Send an Intent

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

Moderator: Gurus

Pigeon14
Posts: 5
Joined: Fri Jul 06, 2018 8:50 pm

Send an Intent

Post by Pigeon14 »

What would be the command/extras for sending an intent for media monkey to start playing music or to play a certain song?
Peke
Posts: 17493
Joined: Tue Jun 10, 2003 7:21 pm
Location: Earth
Contact:

Re: Send an Intent

Post by Peke »

Hi,
check these commands http://www.mediamonkey.com/support/inde ... ediamonkey you can also access/command thru scripting
Best regards,
Peke
MediaMonkey Team lead QA/Tech Support guru
Admin of Free MediaMonkey addon Site HappyMonkeying
Image
Image
Image
How to attach PICTURE/SCREENSHOTS to forum posts
Pigeon14
Posts: 5
Joined: Fri Jul 06, 2018 8:50 pm

Re: Send an Intent

Post by Pigeon14 »

Peke wrote: Sat Jul 07, 2018 5:21 am Hi,
check these commands http://www.mediamonkey.com/support/inde ... ediamonkey you can also access/command thru scripting
I believe those commands are only for the windows version?
martin.bohac
Posts: 241
Joined: Thu Nov 14, 2013 5:23 pm

Re: Send an Intent

Post by martin.bohac »

You are right, intents for Android version are described here: https://www.mediamonkey.com/wiki/index. ... d_dev_docs
Pigeon14
Posts: 5
Joined: Fri Jul 06, 2018 8:50 pm

Re: Send an Intent

Post by Pigeon14 »

That is what I was looking for. Thanks!

Now as for how to utilize it, I can get the sync to start by creating this intent in tasker:

Code: Select all

Send Intent [ 
 Action: com.ventismedia.android.mediamonkey.ACTION_START_SYNCHRONIZATION
 Cat: None
 Mime Type: 
 Data:
 Extra: 
 Extra: 
 Package: 
 Class: 
 Target: Broadcast Receiver
]
But I cannot figure out how to use "com.ventismedia.android.mediamonkey.ACTION_MEDIA_BUTTON". Any tips? I'm likely using the extras wrong.
martin.bohac
Posts: 241
Joined: Thu Nov 14, 2013 5:23 pm

Re: Send an Intent

Post by martin.bohac »

You have to put extra "KeyEvent" object as an instance of android.view.KeyEvent class,
what tasker app are you using? Are you able to add such an object?
The KeyEvent object must have to set action as KeyEvent.ACTION_DOWN AND KeyCode according to what you want to do,
supported key codes:

KeyEvent.KEYCODE_HEADSETHOOK
KeyEvent.KEYCODE_MEDIA_PLAY
KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE
KeyEvent.KEYCODE_MEDIA_PAUSE
KeyEvent.KEYCODE_MEDIA_NEXT
KeyEvent.KEYCODE_MEDIA_PREVIOUS
KeyEvent.KEYCODE_MEDIA_FAST_FORWARD
KeyEvent.KEYCODE_MEDIA_REWIND
KeyEvent.KEYCODE_MEDIA_STOP
Pigeon14
Posts: 5
Joined: Fri Jul 06, 2018 8:50 pm

Re: Send an Intent

Post by Pigeon14 »

I figured out how to send an intent using java following the example on the wiki page. It works fine but if I change "android.intent.action.MEDIA_BUTTON" to "com.ventismedia.android.mediamonkey.ACTION_MEDIA_BUTTON" it does not work anymore. I attached pictures of my tasker function.

If I delete function 4 it will pause/play the currently running media player including mediamonkey. If I delete function 4 nothing happens.
Image
martin.bohac
Posts: 241
Joined: Thu Nov 14, 2013 5:23 pm

Re: Send an Intent

Post by martin.bohac »

There was a regression and "com.ventismedia.android.mediamonkey.ACTION_MEDIA_BUTTON" does not work correctly (fixed in next build),
but a better way to achieve this goal in "Tasker" is via Action from Category "Media"/"Media Control" and you can specify command and app. Did you try it?
Pigeon14
Posts: 5
Joined: Fri Jul 06, 2018 8:50 pm

Re: Send an Intent

Post by Pigeon14 »

martin.bohac wrote: Wed Jul 11, 2018 1:05 pm There was a regression and "com.ventismedia.android.mediamonkey.ACTION_MEDIA_BUTTON" does not work correctly (fixed in next build),
but a better way to achieve this goal in "Tasker" is via Action from Category "Media"/"Media Control" and you can specify command and app. Did you try it?
I did not try that but it would have saved me A LOT of time haha. Thanks for the info on the regression!
Post Reply