diff --git a/player/player.py b/player/player.py index 769d8b2..51077d8 100755 --- a/player/player.py +++ b/player/player.py @@ -28,7 +28,8 @@ CONFIG = { "sub_border_color": "0.0/0.0/0.0/0.75", "sub_margin": 2 * 36 + 6, "sub_spacing": 0, - "vf": None + "vf": None, + "sync_group": None, } @@ -277,6 +278,8 @@ class Sync(Thread): "%0.4f %s" % (self.mpv.time_pos, self.mpv.playlist_current_pos) ).encode() + if CONFIG.get("sync_group"): + msg = (b"%s " % CONFIG["sync_group"]) + msg except: return try: @@ -307,6 +310,11 @@ class Sync(Thread): except OSError: logger.error("socket closed") else: + if CONFIG.get("sync_group"): + if data[0] != str(CONFIG["sync_group"]): + return self.read_position_main() + else: + data = data[1:] self._last_ping = data[0] if data[0] == "pause": self.is_paused = True