Browse Source

lua/intf/cli: make info command more versatile

Prior to this patch, the "info"-command could only be used to query
information related to the currently playing entity. These changes
allow the user to get information about other entities in the
playlist, based on the playlist-id.

fixes #17549

Signed-off-by: Pierre Ynard <linkfanel@yahoo.fr>
pull/50/head
Filip Roséen 10 years ago
committed by Pierre Ynard
parent
commit
24d0d1e46f
  1. 10
      share/lua/intf/cli.lua

10
share/lua/intf/cli.lua

@ -353,8 +353,12 @@ function help(name,client,arg)
client:append("+----[ end of help ]")
end
function input_info(name,client)
local item = vlc.input.item()
function input_info(name,client,id)
local item = nil;
if id then item = (vlc.playlist.get(id) or {})["item"]
else item = vlc.input.item() end
if(item == nil) then return end
local infos = item:info()
infos["Meta data"] = item:metas()
@ -585,7 +589,7 @@ commands_ordered = {
{ "rate"; { func = rate; args = "[playback rate]"; help = "set playback rate to value" } };
{ "frame"; { func = frame; help = "play frame by frame" } };
{ "fullscreen"; { func = skip2(vlc.video.fullscreen); args = "[on|off]"; help = "toggle fullscreen"; aliases = { "f", "F" } } };
{ "info"; { func = input_info; help = "information about the current stream" } };
{ "info"; { func = input_info; args= "[X]"; help = "information about the current stream (or specified id)" } };
{ "stats"; { func = stats; help = "show statistical information" } };
{ "get_time"; { func = get_time("time"); help = "seconds elapsed since stream's beginning" } };
{ "is_playing"; { func = is_playing; help = "1 if a stream plays, 0 otherwise" } };

Loading…
Cancel
Save