Commit a9e4799e authored by Rémi Duraffort's avatar Rémi Duraffort

luahttp: fix service discovery loading.

parent 089ce510
...@@ -83,7 +83,13 @@ This dialog needs the following dialogs to be fully functional: <none> ...@@ -83,7 +83,13 @@ This dialog needs the following dialogs to be fully functional: <none>
<?vlc <?vlc
local sd = vlc.sd.get_services_names() local sd = vlc.sd.get_services_names()
for n,ln in pairs(sd) do for n,ln in pairs(sd) do
print([[<button onclick="pl_sd(']]..n..[[');hide_menu('menu_sd');" onmouseover="setclass(this,'menuover');" onmouseout="setclass(this,'menuout');" class="menuout" title="Toggle ]]..ln..[[" >]]..ln..[[</button><br/>]]) local sdname = string.gsub(n, "([^{]*)({.*)", "%1")
local islua = 0
if(sdname == "lua") then
sdname = string.gsub(n, "(lua{sd=')([^']*)'(.*)", "%2")
islua = 1
end
print([[<button class="menuout" onclick='pl_sd("]]..sdname..[[", "]]..islua..[[");hide_menu("menu_sd");' onmouseover="setclass(this,'menuover');" onmouseout="setclass(this,'menuout');" class="menuout" title="Toggle ]]..ln..[[" >]]..ln..[[</button><br/>]])
end end
?> ?>
</div> </div>
......
...@@ -360,9 +360,9 @@ function pl_repeat() ...@@ -360,9 +360,9 @@ function pl_repeat()
{ {
loadXMLDoc( 'requests/status.xml?command=pl_repeat', parse_status ); loadXMLDoc( 'requests/status.xml?command=pl_repeat', parse_status );
} }
function pl_sd( value ) function pl_sd( value, islua )
{ {
loadXMLDoc( 'requests/status.xml?command=pl_sd&val='+value, parse_status ); loadXMLDoc( 'requests/status.xml?command=pl_sd&val='+value+'&islua='+islua, parse_status );
} }
/* misc actions */ /* misc actions */
......
...@@ -79,10 +79,15 @@ elseif command == "pl_loop" then ...@@ -79,10 +79,15 @@ elseif command == "pl_loop" then
elseif command == "pl_repeat" then elseif command == "pl_repeat" then
vlc.playlist.repeat_() vlc.playlist.repeat_()
elseif command == "pl_sd" then elseif command == "pl_sd" then
if vlc.sd.is_loaded(val) then if(_GET['islua'] == "1") then
vlc.sd.remove(val) sdname = "lua{sd='" .. val .. "'}"
else else
vlc.sd.add(val) sdname = val
end
if vlc.sd.is_loaded(sdname) then
vlc.sd.remove(sdname)
else
vlc.sd.add(sdname)
end end
elseif command == "fullscreen" then elseif command == "fullscreen" then
vlc.fullscreen() vlc.fullscreen()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment