diff --git a/syncplay/constants.py b/syncplay/constants.py index 498848f..d00258d 100644 --- a/syncplay/constants.py +++ b/syncplay/constants.py @@ -133,9 +133,10 @@ STYLE_NOTCONTROLLER_COLOR = 'grey' USERLIST_GUI_USERNAME_OFFSET = 21 # Pixels MPLAYER_SLAVE_ARGS = ['-slave', '--hr-seek=always', '-nomsgcolor', '-msglevel', 'all=1:global=4:cplayer=4', '-af', 'scaletempo'] -# --quiet works with both mpv 0.2 and 0.3 -MPV_SLAVE_ARGS = ['--force-window', '--idle', '--hr-seek=always', '--quiet', '--keep-open', '--af=scaletempo', '--input-terminal=no', '--input-file=/dev/stdin'] +MPV_SLAVE_ARGS = ['--hr-seek=always', '--quiet', '--af=scaletempo', '--input-terminal=no', '--input-file=/dev/stdin'] MPV_SLAVE_ARGS_NEW = ['--term-playing-msg=\nANS_filename=${filename}\nANS_length=${=length}\nANS_path=${path}\n', '--terminal=yes'] +MPV_SLAVE_GUI = ['--force-window', '--idle', '--keep-open'] +MPV_SLAVE_GUI_NEW = ['--profile=pseudo-gui', '--keep-open=always'] MPV_NEW_VERSION = False VLC_SLAVE_ARGS = ['--extraintf=luaintf', '--lua-intf=syncplay', '--no-quiet', '--no-input-fast-seek', '--play-and-pause', '--start-time=0'] diff --git a/syncplay/players/mpv.py b/syncplay/players/mpv.py index 09abe2a..a31a2f5 100644 --- a/syncplay/players/mpv.py +++ b/syncplay/players/mpv.py @@ -24,6 +24,16 @@ class MpvPlayer(MplayerPlayer): @staticmethod def getStartupArgs(path): args = constants.MPV_SLAVE_ARGS + + try: + pseudogui = subprocess.check_output([path, '--profile=help']) + except: + pseudogui = '' + if 'pseudo-gui' in pseudogui: + args.extend(constants.MPV_SLAVE_GUI_NEW) + else: + args.extend(constants.MPV_SLAVE_GUI) + if constants.MPV_NEW_VERSION: args.extend(constants.MPV_SLAVE_ARGS_NEW) return args