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