KeyRoutines
ConditionFreecond.media.playing

Check if music or video is playing on Windows 11

Media is playing is true while a player is actively playing. Check any player or one in particular, such as Spotify, so a routine can pause music only when there is music to pause.

How it works

  • Name a player such as Spotify, a browser or VLC, or leave it empty for any player.
  • Paused and stopped players don't count; only something actually playing does.
  • Players are the ones Windows shows in its media controls, matched loosely by name.
  • In a Wait until, such as 'wait until the music stops', it reacts to Windows' player updates rather than checking again and again.

Routines that use it

Pause only if playing

When a call starts, if media is playing, Media control pauses it and Set variable notes that, so the routine only presses play later if it paused something.

Sleep after the album

At night, Wait until media is no longer playing, then Sleep puts the PC to sleep.

Shush the speakers

When Audio device changed reports the headphones disconnecting, check if Spotify is playing before pausing it.

Good to know

  • Only players that report to Windows' media controls can be seen.

Questions

Can a routine wait until my music stops?
Yes. Put Media is playing in a Wait until set to wait for it to be false. The routine continues as soon as the player stops or pauses.
Which players does it work with?
Any player that shows up in Windows' media controls, such as Spotify, browsers, Media Player and VLC.

Pairs well with

Build this routine in KeyRoutines

Free from the Microsoft Store for Windows 11 and 10. Pro is a one-time upgrade.