HTTP获取VLC播放器的状态

时间:2014-01-08 21:21:58

标签: javascript xml http qml vlc

所以我继续在QML上继续我的VLC遥控器工作并完成了很多工作我现在能够控制大部分基本功能:)但我需要了解播放器的实际状态。

要发送我的命令,我使用以下代码:

function passCommands(command)
{
    var http = new XMLHttpRequest()
    var url = "http://" + ip + ":" + port + "/requests/status.xml?command=" + command;

    http.open("POST", url, true);

    // Send the proper header information along with the request
    http.setRequestHeader("Authorization", "Basic " + Qt.btoa(username + ":" + password));
    http.send();
}

我现在要做的是从

获取数据
http://192.168.2.2:8080/requests/status.xml

因为这就是VLC播放器如何存储它的状态,它看起来像这样:

<root>
   <fullscreen>false</fullscreen>
   <aspectratio>default</aspectratio>
   <audiodelay>0</audiodelay>
   <apiversion>3</apiversion>
   <currentplid>16</currentplid>
   <time>1</time>
   <volume>128</volume>
   <length>6450</length>
   <random>false</random>

所以我试图访问我查看XmlListModel的status.xml中的信息但是很困惑。 可以重写我当前的函数以从status.xml文件中获取我想要的信息吗?

由于

0 个答案:

没有答案