Scripts switch between players using MPRIS D-bus specification. Made as workaround for distros using Gnome in order to use mediakeys regardless of their default priority.
The scripts require the commands python (associated to Python 3), zenity and dbus-send.
Place all the files in the same directory.
The script to switch players is:
$sh mpris_switch.sh
which will prompt a Zenity form listing all the available players (documentation).
The commands to control the selected player are:
$sh mpris_controler.sh PlayPause
$sh mpris_controler.sh Next
$sh mpris_controler.sh Previous
$sh mpris_controler.sh Stop
You can create a key binding to trigger the scripts. For example, mapping multimedia keys such as XF86AudioPlay, XF86AudioStop, XF86AudioPrev and XF86AudioNext, or using modifiers to create keyboard shortcuts (e.g. Alt+Stop, or Alt+Fn+Right in some laptops).
These scripts where made for personal use and aren't tested in more machines than mine. All files must be in the same directory to work.