mirror of https://github.com/Syncplay/syncplay
Check for VLC 2.2.1 (to avoid seek errors), upver to 1.3.0 Beta 3d
This commit is contained in:
parent
2b1c2430a4
commit
c3025d9174
|
@ -5,7 +5,7 @@
|
|||
Principal author: Etoh
|
||||
Other contributors: DerGenaue, jb
|
||||
Project: http://syncplay.pl/
|
||||
Version: 0.2.5
|
||||
Version: 0.2.6
|
||||
|
||||
Note:
|
||||
* This interface module is intended to be used in conjunction with Syncplay.
|
||||
|
@ -38,6 +38,9 @@ You may also need to re-copy the syncplay.lua file when you update VLC.
|
|||
get-interface-version
|
||||
* >> interface-version: [syncplay connector version]
|
||||
|
||||
get-vlc-version
|
||||
* >> vlc-version: [VLC version]
|
||||
|
||||
get-duration
|
||||
* >> duration: [<duration/no-input>]
|
||||
|
||||
|
@ -81,7 +84,8 @@ You may also need to re-copy the syncplay.lua file when you update VLC.
|
|||
|
||||
--]==========================================================================]
|
||||
|
||||
local connectorversion = "0.2.5"
|
||||
local connectorversion = "0.2.6"
|
||||
local vlcversion = vlc.misc.version()
|
||||
local durationdelay = 500000 -- Pause for get_duration command etc for increased reliability (uses microseconds)
|
||||
local loopsleepduration = 2500 -- Pause for every event loop (uses microseconds)
|
||||
local quitcheckfrequency = 20 -- Check whether VLC has closed every X loops
|
||||
|
@ -473,6 +477,7 @@ function do_command ( command, argument)
|
|||
local response = ""
|
||||
|
||||
if command == "get-interface-version" then response = "interface-version"..msgseperator..connectorversion..msgterminator
|
||||
elseif command == "get-vlc-version" then response = "vlc-version"..msgseperator..vlcversion..msgterminator
|
||||
elseif command == "get-duration" then response = "duration"..msgseperator..errormerge(get_duration())..msgterminator
|
||||
elseif command == "get-filepath" then response = "filepath"..msgseperator..errormerge(get_filepath())..msgterminator
|
||||
elseif command == "get-filename" then response = "filename"..msgseperator..errormerge(get_filename())..msgterminator
|
||||
|
@ -523,7 +528,7 @@ function set_playstate(argument)
|
|||
return errormsg
|
||||
end
|
||||
|
||||
if string.sub(vlc.misc.version(),1,2) == "1." then
|
||||
if string.sub(vlcversion,1,2) == "1." then
|
||||
vlc.msg.err("This version of VLC is not known to support the Syncplay interface module. Please use VLC 2+.")
|
||||
quit_vlc()
|
||||
else
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
version = '1.3.0'
|
||||
milestone = 'Chami'
|
||||
release_number = '7'
|
||||
release_number = '8'
|
||||
projectURL = 'http://syncplay.pl/'
|
||||
|
|
|
@ -62,8 +62,8 @@ COMMANDS_CREATE = ['c','create']
|
|||
COMMANDS_AUTH = ['a','auth']
|
||||
COMMANDS_TOGGLE = ['t','toggle']
|
||||
MPC_MIN_VER = "1.6.4"
|
||||
VLC_MIN_VERSION = "2.0.0"
|
||||
VLC_INTERFACE_MIN_VERSION = "0.2.5"
|
||||
VLC_MIN_VERSION = "2.2.1"
|
||||
VLC_INTERFACE_MIN_VERSION = "0.2.6"
|
||||
VLC_LATENCY_ERROR_THRESHOLD = 2.0
|
||||
CONTROLLED_ROOMS_MIN_VERSION = "1.3.0"
|
||||
USER_READY_MIN_VERSION = "1.3.0"
|
||||
|
|
|
@ -191,17 +191,11 @@ class VlcPlayer(BasePlayer):
|
|||
self._filechanged = True
|
||||
self._filename = value.decode('utf-8')
|
||||
self._filenameAsk.set()
|
||||
elif line.startswith("interface-version: "):
|
||||
interface_version = line[19:24]
|
||||
if int(interface_version.replace(".", "")) < int(constants.VLC_INTERFACE_MIN_VERSION.replace(".", "")):
|
||||
self._client.ui.showErrorMessage(getMessage("vlc-interface-version-mismatch").format(str(interface_version), str(constants.VLC_INTERFACE_MIN_VERSION)))
|
||||
elif line[:16] == "VLC media player":
|
||||
vlc_version = line[17:22]
|
||||
if int(vlc_version.replace(".", "")) < int(constants.VLC_MIN_VERSION.replace(".", "")):
|
||||
elif line.startswith("vlc-version: "):
|
||||
vlc_version = line.split(': ')[1].replace(' ','-').split('-')[0]
|
||||
if not utils.meetsMinVersion(vlc_version, constants.VLC_MIN_VERSION):
|
||||
self._client.ui.showErrorMessage(getMessage("vlc-version-mismatch").format(str(vlc_version), str(constants.VLC_MIN_VERSION)))
|
||||
self._vlcready.set()
|
||||
self._listener.sendLine("get-interface-version")
|
||||
|
||||
|
||||
@staticmethod
|
||||
def run(client, playerPath, filePath, args):
|
||||
|
@ -262,6 +256,7 @@ class VlcPlayer(BasePlayer):
|
|||
class __Listener(threading.Thread, asynchat.async_chat):
|
||||
def __init__(self, playerController, playerPath, filePath, args, vlcReady, vlcClosed):
|
||||
self.__playerController = playerController
|
||||
self.requestedVLCVersion = False
|
||||
call = [playerPath]
|
||||
if filePath:
|
||||
if utils.isASCII(filePath):
|
||||
|
@ -277,7 +272,7 @@ class VlcPlayer(BasePlayer):
|
|||
for line in interfacefile:
|
||||
if "local connectorversion" in line:
|
||||
interface_version = line[26:31]
|
||||
if int(interface_version.replace(".", "")) >= int(constants.VLC_INTERFACE_MIN_VERSION.replace(".", "")):
|
||||
if utils.meetsMinVersion(interface_version, constants.VLC_INTERFACE_MIN_VERSION):
|
||||
return True
|
||||
else:
|
||||
playerController._client.ui.showErrorMessage(getMessage("vlc-interface-oldversion-ignored"))
|
||||
|
@ -362,6 +357,9 @@ class VlcPlayer(BasePlayer):
|
|||
|
||||
def sendLine(self, line):
|
||||
if self.connected:
|
||||
if not self.requestedVLCVersion:
|
||||
self.requestedVLCVersion = True
|
||||
self.sendLine("get-vlc-version")
|
||||
try:
|
||||
self.push(line + "\n")
|
||||
self.__playerController._client.ui.showDebugMessage("player >> {}".format(line))
|
||||
|
|
Loading…
Reference in New Issue