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


- nad - 2005-07-13

i have uploaded xbmc controller v1.1 to sourceforge.

added: screen tab - provides simulated mouse input to xbmc gui (click refresh menu to update screen)
added: new ini settings for rotate (rotates the display of the screen tab - useful for ppc usage) and size (changes the window size of xbmc controller)
added: now by default uses the xbmc file extensions for music, video and pictures. override by adding the ini setting "usexbmcextensions=false"

this should be used with the latest csv version of xbmc which now exposes all commands through asp.

nad


- thor918 - 2005-07-15

would be cool to have all these xbmcapi commands exposed to python scripts  :bomb:


- Livin - 2005-07-15

thor,
it might be a "backdoor" but what about using nads api from python? i'd think you could call the http commands from a python script, right?


- thor918 - 2005-07-16

sure. but would be better to have the option to have the web services turned off.
as it is now i can access api uing http get from python if the webservice is on.
and another thing. shouldn't it be some sequrity on this?


- nad - 2005-07-16

exposing the httpapi command to python should be straightforward, in fact i did it just now by expanding the "executebuiltin" function, but then i realised that there was no route back to the python script for the return values.

i don't know python at all. based on the executebuiltin approach or something similar, any idea on how to return values to the calling script?

[edit]
just seen how to do it - i think. don't hold your breath though.


nad






- pulp_136 - 2005-07-18

Quote:you can definitely use vb6. however, you won't be able to use my module directly, you will first to port it from vb.net which should be very straightforward. in fact it was something i was planning on doing.

i searched the net for porting to vb6 but couldn't find anything (all results was for the other way round). now, nad, could you make that port or could you assist me in doing it? i do not own vb.net, is it a must?

affini, i'm afraid i'm far from being your man. i'm not a programmer, i learned some vb6 while studying and i do some programming as a hobby in the very limited free time i have. if i ever finish this i'm going to see what it takes to make a freeware out of it that everybody can use. but for now i have a hard time setting it up myself !!!


- thor918 - 2005-07-18

and now for a good question.why do you want to port it to vb6?

anyway vb6 and vb.net ar basicly written the same way.
some major changes is that in vb.net is that you get most of the objects you need builtin. in vb6 you will have to use activex object or windows api calls. it should go pretty fast to convert it to vb6 as most of the vb.net code would be copy and paste. you need first to get a working code to make http get calls in vb6.
take one step at the time and it should go well.


- nad - 2005-07-20

here is one way to do it in vb6 vb6 example project.

if it is not obvious:

enter the http api command in the command box e.g. setcurrentplaylist
enter any parameters in the parameter box e.g. 1
click send.

the response from xbmc will then populate the big textbox.

remember to enter multiple parameters separated with a semi-colon.

nad


- pulp_136 - 2005-07-21

too fast, too good.

thank you ned


- thor918 - 2005-07-22

nice nad. i see you have added execute command.
haven't compiled the cvs yet. Wink this looks promising.
is it highly experemential or fully functional code?

anyway i'm going to check it out now :d


- mhernie - 2005-07-22

anyone tried to send/receive http api commands using flash mx?

i'm playing around with a waci+ network control device from aurora multimedia.

waci homepage

this device will let me easily setup html or flash control pages to integrate control of ir and serial (rs-232) devices (vcr, cable box, projector, receiver) through tcp/ip. all of the control/web pages are stored on this device (i.e. no running pc required). the holy grail for me (and probably affini too) would be to integrate control of home theater devices and xbmc from one touchscreen interface.

the waci device can be also be programmed using asp, vb, java, etc..

waci programming

i am not a programmer, but am pretty adept at learning by example. i have already created integrated touchscreen control pages for all of my devices (including the xbox) through ir and rs232. but this is really just a fancy network remote control for sending commands to different devices. no feedback from xbmc can be done through ir.

what would be infinitely better would be to integrate ir and rs232 devices (for home theater components) and http api commands for xbmc. this would enable me to integrate lighting, home theater control, xbox power on/off (xir mod), and xbmc commands from one touchscreen interface. i can envision xbmc pages where i can get a listing of music, see what's playing, see what's queued, then turn on the projector and turn the volume up on my receiver from the same page.

i'm going to start working on this in flash, though my skills are pretty basic here. thoughts, suggestions, comments are always welcome. i'll keep you posted...


- thor918 - 2005-07-22

i'm guessing the new execute command is not operational code yet. tried it(unknow command returned).
maby i did it wrong?
executehttpapi('xbmc.setplayspeed(2)')

but it's promising i think Wink
thanks nad


- nad - 2005-07-23

thor918: well done for spotting i had made the changes. i wasn't going to announce anything here for a couple of days to make sure i hadn't done anything silly to xbmc since it was quite a major change. things still seem to be quiet so i am probably fairly safe. having said that the new code only kicks in when the api is called.

all the api functions should now be accessible from python (and asp). you have the syntax slightly wrong, it should be:

response = xbmc.executehttpapi("setplayspeed(2)")

and an example of one with more paramaters:

response = xbmc.executehttpapi(“takescreenshot(“q:\\test.jpg”,false,200,-1,90)”)

nad


- nad - 2005-07-23

thor918: you asked why pulp_136 might want to port my app to vb6. i guess the obvious answer would be that pulp does not have access to vb.net, but the reason i wish to have a vb6 version is that vb6 is much less demanding on a computer's resources. my wife has a lowly 200mhz laptop and running a .net app on that spec is not very pleasant.

nad


- thor918 - 2005-07-23

hmm strange i'm most certaint that i tried that command like that.but it was late when i tried it so.hehe
anyway i tried it again like you put it now, and it works Wink
is there any limit on how long the return string can be?

anyway the reson i made the code like that was becuse the python doc you putted in for it said that as an example.
so you will have to change that.
look in html file.that is doc file from python:
http://home.no.net/thor918/xbmc/xbmc.html

executehttpapi(...)
executehttpapi(string) -- execute an http api.

example:
- executehttpapi('xbmc.setplayspeed(2)')

it should be:

executehttpapi(...)
executehttpapi(string) -- execute an http api.

example:
- executehttpapi('setplayspeed(2)')

Wink
i expect you had a little copy and paste from the executebultin doc.hehe and the "xbmc" stayed?

good job nad
thanks
:d