code: def _detect_running_player(self):
          
          supported_players = self.supported_players.split(",")
          running_players = []
          for pid in os.listdir("/proc"):
              if not pid.isdigit():
                  continue
  
              fn = os.path.join("/proc", pid, "comm")
              try:
                  with open(fn, "rb") as f:
                      player_name = f.read().decode().rstrip()
              except:  # noqa e722
                  # (IOError, FileNotFoundError):  # (assumed py2, assumed py3)
                  continue
  
              if player_name in supported_players:
                  running_players.append(player_name)
  
          # Pick which player to use based on the order in self.supported_players
          for player_name in supported_players:
              if player_name in running_players:
                  if self.debug:
                      self.py3.log("found player: %s" % player_name)
  
                  # those players need the dbus module
                  if player_name in ("vlc") and not dbus_available:
                      self.py3.log("%s requires the dbus python module" % player_name)
                      return None
  
                  return player_name
  
          return None
docs: Detect running player process, if any