Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- QML Funtion:
- function getVLCstatus()
- {
- var httpReq = new XMLHttpRequest()
- var url = "http://" + ip + ":" + port + "/requests/status.xml";
- httpReq.open("GET", url, true);
- // Send the proper header information along with the request
- httpReq.setRequestHeader("Authorization", "Basic " + Qt.btoa(username + ":" + password));
- httpReq.setRequestHeader('Content-Type', 'text/xml');
- httpReq.onreadystatechange = function()
- {
- if(httpReq.readyState === XMLHttpRequest.DONE)
- {
- if(httpReq.status == 200)
- {
- var doc = httpReq.responseXML.documentElement;
- for (var ii = 0; ii < doc.childNodes.length; ++ii)
- {
- console.log(doc.childNodes[ii].nodeName);
- console.log(" " + doc.childNodes[ii].nodeValue);
- }
- }
- }
- }
- httpReq.send();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement