Mute VLC or other apps when MS Teams or other call is detected

Hi all,
Sometimes I do watch something either on VLC or Youtube, etc and I receive a MS Teams call. I would like the application (in my case almost always would be VLC) to be muted or paused, when I receive the call, so it doesn't interfere with the call.
Any suggestions how to do that?
There's no window title from the call-in from Teams, it just pops-up non-labeled screen that person/number is calling me and green/red headset to pick up or close the call, so I'm not sure how to identify the behavior. The rest of the action, I can easily manipulate, but can't get to identify the incoming call.

hmmm, since muting and pausing, and resuming playback is just a shortcut away, I wonder if it worth the hassle to automate that ? Because it still need the event to detect if the call has stopped and resume playback. Periodic trigger is certainly not a good way to check for those condition (as this take cpu usage).. Just my thought.

Well, I have main + two other monitors attached, 7-8 different windows open at any time, sometime even more, trust me - it is a hassle to find the pause button of VLC or the mute one, especially if your boss is calling you and run the VLC at 1/6th of a size of the display or so.. I'm thinking on maybe find image, when MS Teams activates (is active.. need to play with it). as the pick up and decline buttons are rather easy to identify. I'll keep trying, unless someone discovered a way already..

Ic. Wish you the best in finding the solution.

@macdevign_mac you're right - I can simply shortcut it to mute the application myself. None the less, I'm very good at forgetting the shortcuts I am putting (for now at least).
I have played a while until I was able to get it right, but I am 90% at the level I wanted to achieve.
Here is how my macro(s) are working:
Triggered, if MS Teams activates -> If screen contents image (pickup/decline part) -> mute VLC
The result of this is that the VLC gets muted right after I accept the call, which is great.
Then as I was unable to make it otherwise I'm calling separate Macro, which monitors the "Leave" screen image condition (I think it's not recognized as a button). The monitoring is done via While statement looping around until the leave button is not anymore visible, then it unmutes the VLC.
Here the issue is that even a hover over the Leave button will unmute the VLC, or obviously if another application gets on top of it as well. Hence 90% so far :slight_smile:

mutevlcifcall

unmutevlc