diff --git a/syncplay/messages.py b/syncplay/messages.py index 2b66e6b..2a61251 100644 --- a/syncplay/messages.py +++ b/syncplay/messages.py @@ -49,6 +49,8 @@ en = { "commandlist-notification/help" : "\th - this help", "syncplay-version-notification" : "Syncplay version: {}", #syncplay.version "more-info-notification" : "More info available at: {}", #projectURL + + "vlc-version-mismatch": "Warning: You are running VLC version {}, but Syncplay is designed to run on VLC {} and above\n", # VLC version, VLC min version # Client prompts "enter-to-exit-prompt" : "Press enter to exit\n", diff --git a/syncplay/players/vlc.py b/syncplay/players/vlc.py index edf5f67..e763a14 100644 --- a/syncplay/players/vlc.py +++ b/syncplay/players/vlc.py @@ -16,9 +16,10 @@ class VlcPlayer(BasePlayer): VLC_MIN_PORT = 10000 VLC_MAX_PORT = 55000 SLAVE_ARGS = ['--extraintf=luaintf','--lua-intf=syncplay'] + VLC_MIN_VERSION = "2.0.6" random.seed() - vlcport = random.randrange(VLC_MIN_PORT, VLC_MAX_PORT) + vlcport = random.randrange(VLC_MIN_PORT, VLC_MAX_PORT) if (VLC_MIN_PORT < VLC_MAX_PORT) else VLC_MIN_PORT SLAVE_ARGS.append('--lua-config=syncplay={{port=\"{}\"}}'.format(str(vlcport))) def __init__(self, client, playerPath, filePath, args): @@ -123,6 +124,9 @@ class VlcPlayer(BasePlayer): self._filename = value self._filenameAsk.set() elif (line[:16] == "VLC media player"): + vlc_version = line[17:22] + if (int(vlc_version.replace(".","")) < int(self.VLC_MIN_VERSION.replace(".",""))): + self._client.ui.showMessage(getMessage("en", "vlc-version-mismatch").format(str(vlc_version), str(self.VLC_MIN_VERSION))) self._vlcready.set() @@ -213,4 +217,4 @@ class VlcPlayer(BasePlayer): def sendLine(self, line): if(self.connected): # print "send: {}".format(line) - self.push(line + "\n") \ No newline at end of file + self.push(line + "\n")