2006-03-01, 19:36
(darkie @ mar. 01 2006,15:45 Wrote:if a new interace is added it is based on xml for sure wich will have only one url. meaning that you can't do something like http://xboxip/xbmcxml?command=something. instead everything will be xml based, both request and response. this means you have to set up an xml message in memory (with javascript for example) and send it to http://xboxip/xbmcxml i don't think it is slower than the current way (you have to strip <li> and such atm)xml can gum up the works quite a bit...
let's say you want to get the files in the current playlist.
it's really painful to have to post to xbmcxml with a body of
Quote:<?xml version="1.0" encoding="utf-8" ?>
<request>
<action>getplaylistcontents</action>
<parameter>1</parameter>
</request>
it's much easier to post to:
xbmcxml?action=getplaylistcontents¶meter=1
it's easier on the back end too (since there's no xml parsing, only the same type of logic that's already written).
in either case, i'd expect a return something like (using attributes to make the xml smaller/faster over the wire) -- also, set the response type to text/xml in order to make it truly an xml response (less hoops to jump through when using xmlhttp in the js side):
Quote:<?xml version="1.0" encoding="utf-8" ?>
<files>
<file pos='0' name='coldplay - x&y.mp3' />
.
.
</files>
i've done both ways, and the second is significantly faster to develop on the back end (with less room for error, garbage in is easier to detect, no xml parsing issues) and way easier to write/manage on the front end.