Jump to content
Poweramp
Arielcity

send intent to play specified folder using tasker

Recommended Posts

hello,

i want to play specified folder in Poweramp with send intent using tasker

hear is the code in tasker:

A1: Send Intent [ 
    Action:com.maxmpz.audioplayer.API_COMMAND 
    Cat:None 
    Mime Type: 
    Data:content://com.maxmpz.audioplayer.data/folders="Bla Bla" 
    Extra: cmd: 20 
    Extra: shuffle: 2 
    Extra: 
    Package: 
    Class: 
    Target:Service ] 

But this doesn't work.

What is wrong with this code?

Hear are some stuff from  PowerampAPI.java

/**
* Data:<br>
* - uri, following URIs are recognized:<br>
* - file://path<br>
* - content://com.maxmpz.audioplayer.data/... (see below)<br><br>
*
* # means some numeric id (track id for queries ending with /files, otherwise - appropriate category id).<br>
* If track id (in place of #) is not specified, Poweramp plays whole list starting from the specified track,<br>
* or from first one, or from random one in shuffle mode.<br><br>
*
* All queries support following params (added as URL encoded params, e.g. content://com.maxmpz.audioplayer.data/files?lim=10&flt=foo):<br>
* {@code int lim} - SQL LIMIT, which limits number of rows returned<br>
* {@code String flt} - filter substring. Poweramp will return only matching rows (the same way as returned in Poweramp lists UI when filter is used).<br>
* {@code int shf} - shuffle mode (see ShuffleMode class)<br>
* {@code int shs} - 1 if this is shuffle session (for internal use)<br><br>
<pre>
 
- Plain folders view (just files in plain folders list)
content://com.maxmpz.audioplayer.data/folders
content://com.maxmpz.audioplayer.data/folders/#
content://com.maxmpz.audioplayer.data/folders/#/files
content://com.maxmpz.audioplayer.data/folders/#/files/#
 
- Hierarchy folders view (files and folders intermixed in one cursor)
content://com.maxmpz.audioplayer.data/folders/#/folders_and_files
content://com.maxmpz.audioplayer.data/folders/#/folders_and_files/#
content://com.maxmpz.audioplayer.data/folders/files // All folder files, sorted as folders_files sort (for mass ops).

**/

 

Share this post


Link to post
Share on other sites

The uri would be  Data:content://com.maxmpz.audioplayer.data/folders/1

That means id is required (# == id). To know id you should query Poweramp database, etc. so it won't be easy if you want just to play something with a simple intent.

Instead I suggest using android.media.action.MEDIA_PLAY_FROM_SEARCH with free-form search text:

 Send Intent [ 
    Action:android.media.action.MEDIA_PLAY_FROM_SEARCH 
    Cat:None 
    Mime Type: 
    Data:
    Extra: query: YOUR SEARCH STRING HERE
    Extra: android.intent.extra.user_query: shuffle
    Package: com.maxmpz.audioplayer
    Class: com.maxmpz.audioplayer.ListActivity
    Target:Activity ] 

But this is API is for free format/voice search, so it can't "focus" on folders, it supports targeting on genres/artists/albums or just songs. Also, for specific shuffle mode you need to send additional command, as search query supports just shuffle (and that android.intent.extra.user_query:  depends on device system language).

 

Share this post


Link to post
Share on other sites

Hi,

I'm also looking for a way to play music from specified folders (with MIT App Inventor)!  Too bad it's not possible, I'll try your workaround maxmp but it looks tricky, if anyone has another solution I'm interested ;)

 

Share this post


Link to post
Share on other sites

@BMO it’s possible, but again you should know/get id of the folder first (it can be done via Poweramp API). Or alternatively, search can be used (provided that on android, esp. for latest versions you can’t use path to identify folder anyway).

I’m open for suggestions to improve this, for example, I think it’s possible to add some 1-liner intent to search/play given folder by name (as it’s available now for albums/artists/genres/playlists, that will fail/play invalid folder if there are multiple of them with similar subpath, though).

Share this post


Link to post
Share on other sites

I made some tests to get familiar with Poweramp intents but it's not working really well ?! I can create another topic if you prefer but I feel I'm close. 

- MEDIA_PLAY_FROM_SEARCH didn't work with android.media.action.MEDIA_PLAY_FROM_SEARCH as you mentioned but with the path specified in the doc android.provider.MediaStore.INTENT_ACTION_MEDIA_PLAY_FROM_SEARCH I've got some results : search is working and give me results but play doesn't work.

API_COMMAND opens Poweramp but do nothing else (and I tried simple commands like play/pause).

Visual programming is quite easy to read, here is what I tried :

image.thumb.png.9e7ef1d569941c90752d3b934173cb6a.png

 

PS : I didn't see anything regarding activity class and ListActivity. Is there any other activity I can call ?

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...