Merge pull request #21 from Et0h/master
VLC version checking and min/max port fix
This commit is contained in:
commit
ca3fe0a501
@ -49,6 +49,8 @@ en = {
|
|||||||
"commandlist-notification/help" : "\th - this help",
|
"commandlist-notification/help" : "\th - this help",
|
||||||
"syncplay-version-notification" : "Syncplay version: {}", #syncplay.version
|
"syncplay-version-notification" : "Syncplay version: {}", #syncplay.version
|
||||||
"more-info-notification" : "More info available at: {}", #projectURL
|
"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
|
# Client prompts
|
||||||
"enter-to-exit-prompt" : "Press enter to exit\n",
|
"enter-to-exit-prompt" : "Press enter to exit\n",
|
||||||
|
|||||||
@ -16,9 +16,10 @@ class VlcPlayer(BasePlayer):
|
|||||||
VLC_MIN_PORT = 10000
|
VLC_MIN_PORT = 10000
|
||||||
VLC_MAX_PORT = 55000
|
VLC_MAX_PORT = 55000
|
||||||
SLAVE_ARGS = ['--extraintf=luaintf','--lua-intf=syncplay']
|
SLAVE_ARGS = ['--extraintf=luaintf','--lua-intf=syncplay']
|
||||||
|
VLC_MIN_VERSION = "2.0.6"
|
||||||
|
|
||||||
random.seed()
|
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)))
|
SLAVE_ARGS.append('--lua-config=syncplay={{port=\"{}\"}}'.format(str(vlcport)))
|
||||||
|
|
||||||
def __init__(self, client, playerPath, filePath, args):
|
def __init__(self, client, playerPath, filePath, args):
|
||||||
@ -123,6 +124,9 @@ class VlcPlayer(BasePlayer):
|
|||||||
self._filename = value
|
self._filename = value
|
||||||
self._filenameAsk.set()
|
self._filenameAsk.set()
|
||||||
elif (line[:16] == "VLC media player"):
|
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()
|
self._vlcready.set()
|
||||||
|
|
||||||
|
|
||||||
@ -213,4 +217,4 @@ class VlcPlayer(BasePlayer):
|
|||||||
def sendLine(self, line):
|
def sendLine(self, line):
|
||||||
if(self.connected):
|
if(self.connected):
|
||||||
# print "send: {}".format(line)
|
# print "send: {}".format(line)
|
||||||
self.push(line + "\n")
|
self.push(line + "\n")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user