3

New media test action/state monitor

An action that can be performed inside of a task that will test and return the current media state variables similar to the event trigger "Music track changed". This would allow tasker to be configured to check the media state in the event that tasker detected music playing, was disabled, and then re-enabled but music was no longer playing. Basically a manual check in case of error. 

The only way I can see currently to do this, is to configure a AutoNotification state monitor that checks for media notifications with certain apps. But would be great to have built into tasker. 

3 replies

LF

Hi,

Is there any way to detect whether a track changed or play/pause state changed when the app is in the foreground?

I'm trying to mute notifications when I'm playing media (YouTube, Spotify, streaming videos...). The auto notification event is triggered whenever the app is in background, because they have a notification and update it. But if the app is in foreground (mainly video apps), usually they don't have any notification so auto notification does not detect anything.

TT

I never realized AutoNotification had a media action. Guess I've never paid attention lol. So yes that action would work. But the only way I could theoretically set it up is create a profile that triggers whenever the variable is set, and possibly use a tick to check the status of the media state. 

But wouldn't that slow the system down or consume more resources by continuously running that while music is playing?

Hhmm, sorry, but I don't understand. Why would you need to continuosly check? The "Music Track Changed" event will trigger any time there's a change :)

TT

It will, but only if tasker recognizes it. In this particular example, it wouldn't. 

1) Music is playing

2) Tasker is manually disabled

3) Music stops

4) Tasker is re-enabled

In this case tasker would never be updated that music had stopped until music is changed again (Music is played again). 

It's more of a backup in case tasker doesn't recognize the change. Which is very very unlikely, but possible.

In that case you can simply update your global variables when the Tasker monitor starts up? :) That way the updates when Tasker was disabled won't be missed.

TT

Yeah I thought about using that for that scenario after I said that. Thanks! 

Would that also work if I restored a tasker backup? Say I went to an older backup and the variable got set. If I restored to my current backup, would that task fire when applying the restored backup? And if not, is there any way that could be achieved? 

Would it work for what you wanted if you create a profile with the "Music Track Changed" event and in the task simply store the various variables you're interested in in Global variables? That way you can check them whenever you want...

TT

Well I have it setup already that way. I have a global variable labeled "MUSICISPLAYINGVAR" that stores in tasker which media app I'm using (I.E 1=YT Music). The problem is, if the status of media playing is changed while tasker say is disabled, the events don't seem to trigger to update that variable or in this case, clear the variable because nothing is playing. 

So currently my solution to this is to use AutoNotification intercept to check if there isn't a media notification shown, with that variable in the conditions as being "If Set". And then it will perform the functions I want in the event that that status changes and tasker isn't monitoring it. 

That being said, I know that the event triggers Everytime music is changed, so this doesn't apply to music playing as it updates at minimum, when the track changes. This is specifically a monitor for checking if music is playing or not playing.

Hmmm, does maybe the "AutoNotification Media" action help to get the info you want then?