Kodi Community Forum
WebServer HTTP API (HttpApi): for PocketPC and Web-client Remote Control Apps - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Kodi Application (https://forum.kodi.tv/forumdisplay.php?fid=93)
+--- Thread: WebServer HTTP API (HttpApi): for PocketPC and Web-client Remote Control Apps (/showthread.php?tid=8760)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38


- incognegro - 2005-12-18

(kraqh3d @ dec. 18 2005,02:57 Wrote:cool. that worked... first off, it's rather bad that it gets the bookmark listing from xboxmediacenter.xml and not from xbmc as its running. this will lead to a few problems...

multipath bookmarks definately wont work as they use an internal protocol to mark them as such. and special directory tags like $screenshots wont work either. both of these bookmark types are processed by xbmc and the paths converted as xboxmediacenter.xml is read in.

also, samba paths of smb://domain;user:pass@someserver/share/path just dont seem to work at all.
i see.....so the way the applications see shares would have to be changed? no one can help me with the clipboard issue?


- incognegro - 2005-12-18

ok i think i undertsand the clipboard thing, all i have to do is copy the link and then play the clipboard! that is the coolest thing.....but it doesnt seem to work! xbmc tries to execute the command (i see the dialog on screen say its executing the stream) but after that the dialog disappears and no response Sad


- nad - 2005-12-18

incognegro: setting up the clipboard to work is rather convoluted but once it is set up it works well for me at least.

i assume you have read the readme.txt from that comes with xbmccontrol.

first you need to realise that there are two modes of operation (in fact i have just checked and this information isn't in the readme):

1. xbmccontrol automatically detects when a playable file name is added to the clipboard;
2. the user needs to manually use the play clipboard command.

the above is controlled by a setting on the config tab.

secondly, for xbmc to play the file on the clipboard xbmc needs to be able to recognise the file's path.

e.g. if the file to be played by xbmc is local to the pc running xbmccontrol - c:\music.mp3 - then the c:\ path will need to be mapped to something that xbmc can use to find the file music.mp3. this mapping is handled by the foldermapping xbmccontrol.ini.txt entry:

foldermapping=c:\=smb://servername/c/

the above line tells xbmccontrol to convert the file to play from c:\music.mp3 to smb://servername/c/music.mp3 before sending the command to xbmc.

obviously (?) the local pc must be sharing c:\ as //servername/c/


- nad - 2005-12-18

kraqh3d and anyone else having difficulties getting xbmccontrol communicating with xbmc:

i posted a multi-step checklist on how to fix problems a few posts ago (about a page of responses back); but thanks to kick in da door for fixing kraqh3d's problem.


- nad - 2005-12-18

kick in da door: in response to your question on what is being discussed, it is more than just for web developers. httpapi is a method of controlling xbmc from many different platforms and environments.

example's of different platforms are: a pc, pocketpc and the xbox itself, but virtually anything with a tcp/ip interface should be usable.

example's of different environments are: within xbmc itself using python; asp pages hosted by the xbmc web server; making direct http calls from a remote browser (which is what liquidice629 is trying); and any other environment that can use the http protocol (visual basic as used by xbmccontrol; ms excel (demo of which is on the xbmc sourceforce page) etc).

the point is that if you have any level of development skills, even ms offfice type macros, you should be able to get xbmc to do your bidding.


- nad - 2005-12-18

i have just updated the api docs which can be retrieved from here: api docs

i have added two new commands filesize and setresponseformat. the latter i mentioned a few days ago in this thread and may provide some help for those who don't like parsing the default format.






- pike - 2005-12-18

hi nad, nice work!

any chance of getting 2 decimals with % seeking ? would be darn sweet, see sent pm for details o.o

why ? it's the only way to get realistic timejump using %


- TeknoJuce - 2005-12-19

hey nad great work with the webserver so far few things though was talking with jmarshall and he told me to refer my questions to you:

irc convo:
[17:56:20] <teknojuce> well the last bug any ways was file names with "&" in them kills it
[17:57:24] <jmarshall> yeah, that'd kill it as it uses that for the command separation i guess.
[17:57:45] <jmarshall> nad is the author of httpapi - best contacted via sf perhaps?
[17:58:16] <teknojuce> yeah thats what i thought about & guessing theres no way around that then
[17:58:21] <teknojuce> besides renaming the files
[17:59:11] <jmarshall> it should encode the urls probably (eg replace with &amp or whatever)

next:
irc convo:
[17:40:27] <teknojuce> also http://192.168.1.101/xbmccmd....;.wma;1 <-- this "1" is supposed to remove date/time on file listing however it removes folders instead and leaves the dates/times
[17:49:21] <teknojuce> this is what you get back from the webserver when you use the 1
[17:49:21] <teknojuce> 23-12-2004 03:26 ;23-12-2004 04:26 ;23-12-2004 07:20 ;23-12-2004 07:20 ;2-3-2005 00:42 ;23-12-2004 07:21
[17:49:21] <teknojuce> f:\10.mp3 ;23-12-2004 07:20
[17:50:03] <teknojuce> dates are how many folders i have in that dir that i tried to grab listing from

maybe im not using it properly but maybe you can enlighten me on proper use

last but not least dunno if its a typo but in your new doc :
filedownloadfrominterne(url;[filename])
think theres a typo ? filedownloadfrominternet<--(url;[filename])
no biggy just wondering

also is there any way we can get your new filesize to be hitup in nowplaying command also thanks a lot -teknojuce


- kraqh3d - 2005-12-19

semicolon is also a problem character in paths. after the url is retrieved its converted into a semicolon seperated string thats processed. this breaks smb://workgroup;user:pass@server/ style paths.


- nad - 2005-12-19

pike: i sent you a pm yesterday - the functionality you are after should be present.

others: i'll look into fixing your reported problems.


- pike - 2005-12-20

@ nad, im sorry to say i havent received a pm after the last one i sent to you.

so % with 2 decimals are in cvs now ?

and also, im sorry to say you misunderstood me, i dont want filesize as a separate command, i want it present on getcurrentlyplaying Confusedaint:

regards / pike


- TeknoJuce - 2005-12-20

thanks!   :thumbsup:






- nad - 2005-12-22

i hope to be uploading fixes for the semicolon problem (use ;; for a literal and ; for a separator) and the getdirectory bug and pike's request.

as far as the & problem replace all ampersands with %26 (which is the hex of the ascii value of &). any other problem characters should be fixed by taking the same approach.

then i am disappearing for christmas.


- Drongo - 2005-12-23

nad et all,
i have now started using the xmlhttp response object in javascript to retrieve info from the web server. using 'getcurrentlyplaying' seems to work first time but as i repeat the call every few seconds it seems to return the same info. for example for a given song most of the data would normally be the same except for the track time and the percentage, but these also stay the same as when the first call was made. anyone got any ideas as to why this is happening.

happy xmas


- donno - 2005-12-23

good job nad on the httpapi.:bowdown:
loved the xbmc control desktop application. :kickass:
i spend the last two days adding to the code from 1.22 from sf.
it has been auto updated to visual basic 2005 .net
so if it doesn't run at all might need to grab .net framework 2

features/redos
- add the infomation panel (shows freespace, temp and few other bits and pieces
- redid the media tab - made alt method of showing bookmarks

fixes
- if not listening to anything it would msn would still have ' - '
- when playing video it shows as xbox video: filename - video (mainly coz i when i trying never got 'tags')

soon (after x-mas hopefully)
- control tab be finshed - so have more ff/rw
- my files -- a way of copying files (using 2 tree views).

not include is the pocketpc.
links:
pc biniary: biniary link here
source: source code here

hopefully it works fine.
donno out :p