Shorten mpv paused/position update message
This commit is contained in:
parent
22e6230231
commit
84012d14b7
@ -423,10 +423,10 @@ class MpvPlayer(BasePlayer):
|
||||
line = line.replace(constants.MPV_INPUT_BACKSLASH_SUBSTITUTE_CHARACTER, "\\")
|
||||
self._listener.sendChat(line[6:-7])
|
||||
|
||||
if "<paused>" in line and "<position>" in line:
|
||||
update_string = line.replace(">", "<").split("<")
|
||||
if "<paused=" in line and ", pos=" in line:
|
||||
update_string = line.replace(">", "<").replace("=", "<").replace(", ", "<").split("<")
|
||||
paused_update = update_string[2]
|
||||
position_update = update_string[6]
|
||||
position_update = update_string[4]
|
||||
if paused_update == "nil":
|
||||
self._storePauseState(True)
|
||||
else:
|
||||
|
||||
@ -345,7 +345,7 @@ function state_paused_and_position()
|
||||
-- bob
|
||||
local pause_status = tostring(mp.get_property_native("pause"))
|
||||
local position_status = tostring(mp.get_property_native("time-pos"))
|
||||
mp.command('print-text "<paused>'..pause_status..'</paused><position>'..position_status..'</position>"')
|
||||
mp.command('print-text "<paused='..pause_status..', pos='..position_status..'>"')
|
||||
-- mp.command('print-text "<paused>true</paused><position>7.6</position>"')
|
||||
end
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user