Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion syncplay/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -986,6 +986,10 @@ def instaplayConditionsMet(self):
if not self.userlist.currentUser.canControl():
return False

# Check if user is alone in the room and preventAutoplayWhenAloneInRoom is enabled
if self._config["preventAutoplayWhenAloneInRoom"] and self.userlist.areYouAloneInRoom() and not self._recentlyAdvanced():
return False

unpauseAction = self._config['unpauseAction']
if self.userlist.currentUser.isReady() or unpauseAction == constants.UNPAUSE_ALWAYS_MODE:
return True
Expand All @@ -998,9 +1002,15 @@ def instaplayConditionsMet(self):
return False

def autoplayConditionsMet(self):
recentlyAdvanced = self._recentlyAdvanced()

# Check if user is alone in the room and preventAutoplayWhenAloneInRoom is enabled
if self._config["preventAutoplayWhenAloneInRoom"] and self.userlist.areYouAloneInRoom() and not recentlyAdvanced:
return False

if self.seamlessMusicOveride():
self.setPaused(False)
recentlyAdvanced = self._recentlyAdvanced()

return (
self._playerPaused and (self.autoPlay or recentlyAdvanced) and
self.userlist.currentUser.canControl() and self.userlist.isReadinessSupported()
Expand Down
2 changes: 2 additions & 0 deletions syncplay/messages_en.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@
"dontslowdownwithme-label": "Never slow down or rewind others (experimental)",
"pausing-title": "Pausing",
"pauseonleave-label": "Pause when user leaves (e.g. if they are disconnected)",
"preventautoplaywhenaloneinroom-label": "Don't auto-play videos before others join",
"readiness-title": "Initial readiness state",
"readyatstart-label": "Set me as 'ready to watch' by default",
"forceguiprompt-label": "Don't always show the Syncplay configuration window", # (Inverted)
Expand Down Expand Up @@ -424,6 +425,7 @@
"slowondesync-tooltip": "Reduce playback rate temporarily when needed to bring you back in sync with other viewers. Not supported on MPC-HC/BE.",
"dontslowdownwithme-tooltip": "Means others do not get slowed down or rewinded if your playback is lagging. Useful for room operators.",
"pauseonleave-tooltip": "Pause playback if you get disconnected or someone leaves from your room.",
"preventautoplaywhenaloneinroom-tooltip": "Don't auto-play videos before others have joined the room.",
"readyatstart-tooltip": "Set yourself as 'ready' at start (otherwise you are set as 'not ready' until you change your readiness state)",
"forceguiprompt-tooltip": "Configuration dialogue is not shown when opening a file with Syncplay.", # (Inverted)
"nostore-tooltip": "Run Syncplay with the given configuration, but do not permanently store the changes.", # (Inverted)
Expand Down
4 changes: 3 additions & 1 deletion syncplay/ui/ConfigurationGetter.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ def __init__(self):
"filenamePrivacyMode": constants.PRIVACY_SENDRAW_MODE,
"filesizePrivacyMode": constants.PRIVACY_SENDRAW_MODE,
"pauseOnLeave": False,
"preventAutoplayWhenAloneInRoom": False,
"readyAtStart": False,
"unpauseAction": constants.UNPAUSE_IFOTHERSREADY_MODE,
"autoplayInitialState": None,
Expand Down Expand Up @@ -122,6 +123,7 @@ def __init__(self):
"noStore",
"dontSlowDownWithMe",
"pauseOnLeave",
"preventAutoplayWhenAloneInRoom",
"readyAtStart",
"autoplayRequireSameFilenames",
"clearGUIData",
Expand Down Expand Up @@ -201,7 +203,7 @@ def __init__(self):
"fastforwardOnDesync", "dontSlowDownWithMe",
"forceGuiPrompt", "filenamePrivacyMode",
"filesizePrivacyMode", "unpauseAction",
"pauseOnLeave", "readyAtStart", "autoplayMinUsers",
"pauseOnLeave", "preventAutoplayWhenAloneInRoom", "readyAtStart", "autoplayMinUsers",
"autoplayInitialState", "mediaSearchDirectories",
"sharedPlaylistEnabled", "loopAtEndOfPlaylist",
"loopSingleFiles",
Expand Down
3 changes: 3 additions & 0 deletions syncplay/ui/GuiConfiguration.py
Original file line number Diff line number Diff line change
Expand Up @@ -815,6 +815,9 @@ def addReadinessTab(self):
self.pauseonleaveCheckbox = QCheckBox(getMessage("pauseonleave-label"))
self.pauseonleaveCheckbox.setObjectName("pauseOnLeave")
self.readyPauseLayout.addWidget(self.pauseonleaveCheckbox)
self.preventAutoplayWhenAloneInRoomCheckbox = QCheckBox(getMessage("preventautoplaywhenaloneinroom-label"))
self.preventAutoplayWhenAloneInRoomCheckbox.setObjectName("preventAutoplayWhenAloneInRoom")
self.readyPauseLayout.addWidget(self.preventAutoplayWhenAloneInRoomCheckbox)
self.readyLayout.addWidget(self.readyPauseGroup)

# Unpausing
Expand Down