03-09-2022, 02:57 PM
Here is another way to get the data from the vlc http server. Can do it directly from qm no external program needed
typelib WinHttp {662901FC-6951-4854-9EB2-D9A2570F2B2E} 5.1
WinHttp.WinHttpRequest h._create
h.Open("GET" "http://127.0.0.1:8080/requests/status.xml")
h.setRequestHeader("content-type", "application/xml");
str enc.encrypt(4 ":test");;password for vlc http server(username:password) if no usename then just :password
h.SetRequestHeader("Authorization", F"Basic {enc}")
h.send()
err
,out _error.description
,ret
if h.Status=200
,IXml x._create
,x.FromString(h.ResponseText)
,str vlcState =x.RootElement.Child("state").Value
,if vlcState !="stopped"
,,str vlcTime=x.RootElement.Child("time").Value
,,str vlcVolume=x.RootElement.Child("volume").Value
,,str filename=x.Path("root/information/category/info[@name='filename']").Value
,,out vlcTime
,,out vlcVolume
,,out filename
,else
,,out x.RootElement.Child("state").Value