I'm currently developing an web application using jQuery-Ajax to send commands to the vlc-webserver. I was surprised how easy it is, basically. But I got stuck at the command "in_play&input=". Here is the send-command-function I use:
Code: Select all
Player.prototype.sendCommand = function(params, append) {
$.ajax({
url: 'http://' + data.ip + ":" + data.port + '/requests/status.xml',
data: params,
success: function (data, status, jqXHR) {
console.log(data);
},
error: function(data){
console.log("fail")
}
});
}
Code: Select all
in_play&input=file:///home/vlc/Musik/Artist/The%20Chicago%20Story_%20The%20Complete%20Greatest/03%20You're%20The%20Inspiration.m4a
Code: Select all
in_play&input=file%3A%2F%2F%2Fhome%2Fvlc%2FMusik%2FArtist%2FThe%20Chicago%20Story_%20The%20Complete%20Greatest%2F03%20You're%20The%20Inspiration.m4a
This won't work. However if I the first line and paste it in the browser like so:
Code: Select all
http://IP:PORT/requests/status.xml?command=in_play&input=file:///home/vlc/Musik/Artist/The%20Chicago%20Story_%20The%20Complete%20Greatest/03%20You're%20The%20Inspiration.m4a
It seemed to work, but as I was posting the content of the addressbar of my browser into this forum, it did look like this:
Code: Select all
http://IP:PORT/requests/status.xml?command=in_play&input=file:///home/vlc/Musik/Artist/The%20C%E2%80%A6e%20Complete%20Greatest/03%20You%27re%20The%20Inspiration.m4a
Thank you very much,
blck
P.S.
encodeURIComponent does work for request/browse.xml - I'm getting confused