Ok, I figured it out:
1.: A useful tool to find out the ways to access a processes gui is Accessibility Insights for Windows.
2.: I decided to use pynput's keyboard module to emulate the appropriate media key presses.