mirror of
https://github.com/videolan/vlc.git
synced 2024-12-13 03:33:54 +08:00
Add new common.volume(). Understands use of strings like "+10", "-10" or "10" for relative or absolute volume changes. Fixes volume in http interface.
This commit is contained in:
parent
8cce51341d
commit
fd7f9a09f0
@ -89,7 +89,7 @@ elseif command == "fullscreen" then
|
||||
elseif command == "snapshot" then
|
||||
common.snapshot()
|
||||
elseif command == "volume" then
|
||||
vlc.volume.set(tonumber(val))
|
||||
common.volume(val)
|
||||
elseif command == "seek" then
|
||||
common.seek(val)
|
||||
elseif command == "key" then
|
||||
|
@ -85,3 +85,11 @@ function seek(value)
|
||||
vlc.var.set(input,"time",tonumber(value))
|
||||
end
|
||||
end
|
||||
|
||||
function volume(value)
|
||||
if type(value)=="string" and string.sub(value,1,1) == "+" or string.sub(value,1,1) == "-" then
|
||||
vlc.volume.set(vlc.volume.get()+tonumber(value))
|
||||
else
|
||||
vlc.volume.set(tostring(value))
|
||||
end
|
||||
end
|
||||
|
@ -397,7 +397,7 @@ end
|
||||
|
||||
function volume(name,client,value)
|
||||
if value then
|
||||
vlc.volume.set(value)
|
||||
common.volume(value)
|
||||
else
|
||||
client:append(tostring(vlc.volume.get()))
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user