Trying to re-program next/back buttons

38 views
Skip to first unread message

RandaoDa Rando

unread,
Jun 18, 2022, 8:49:23 AM6/18/22
to Tasker
Hey.

So I have an icecast stream streaming a local radio of mine online. I am currently using PowerAmp (music player im sure most of you know) to stream my custom online IceCast stream (it's just an HTTPS url. I can use an m3u as well but it works with just a url too and its easier).

So I have just fed that URL into my PowerAmp and I run it and it works flawlessly. However, I have also made a php script on my server-side which plays the radio stream, to switch back and forth between stations (my IceCast stream is not a real playlist, rather its just one url) and I have a special php script "https://<my_ip>/next_station.php" and "https://<my_ip>/prev_station.php" which automatically changes radio station based on my algorithm. It works awesome.

However, the issue I am trying to automate is, I want that whenever I press BACK/NEXT in the media player, I want Tasker to detect whether I pressed BACK or NEXT track and call the correct php script respectively. I have tried looking up an API/Intent Received from PowerAmp's GitHub, but they only offer a "TRACK_CHANGED" which has 2 issues; 1) I cannot know if user hit NEXT or PREVIOUS, and 2) It is unstable. Even if I pause/play or even if i just start the track from playing nothing at all, this intent is triggered. So it does not work.

Other thing I tried is: Tasker's Music Changed Event trigger - that's great but again, gives no information whether track change happened because of hitting NEXT or PREV or whether it triggered because of anything else. I can add an IF condition for track name, album name and others - but again it doesnt help me solve on running the task ONLY if NEXT/PREV was hit.

The one option that does succeed however is the Media Button State trigger. This works really well but issue is, it only works if I have an external entity trigger the Media Buttons (that is a bluetooth headphone or anything). This is good, I can click next in my car via bluetooth and it works, but issue is, if I click Next from the PowerAmp or VLC or any media player (especially in Android Auto where its different), it fails and does not trigger.

What can I do here? I feel like it is such a basic task and I do not feel that I need to create a full Java Android App to make my custom music player just to re-program next/prev buttons - feels extreme. What can I do? Out of ideas guys

Thank you, 
take care.

RandaoDa Rando

unread,
Jun 18, 2022, 8:58:07 AM6/18/22
to Tasker
One thing I forgot to add is: I do not mind streaming the music with Tasker either. I only chose PowerAmp because it was the most stable in automatically resuming my stream is I have internet connection dropout. I used VLC, but if I have 2-3 dropouts, VLC stops trying to re-stream the radio and I have to manually play again. PowerAmp keeps trying until I quit manually which is why I am trying to use PowerAmp.
If I can make a custom method in Tasker to stream an online URL stream and it retries - that will be awesome since at the end of the day, the application that controls the next/prev buttons can help us here by telling us (because of course it knows what button was clicked) - so if tasker can become the application it should be easier. But obviously its easier said than done.
Reply all
Reply to author
Forward
0 new messages