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


- TeknoJuce - 2006-01-30

the acual webserver gui does it is there any posible way to grab code from how it does it and add it to getmedialocation ?


- kraqh3d - 2006-01-30

of course.


- TeknoJuce - 2006-01-30

awesome thats the confidence i like to hear Smile
you amaze me as always kraqh3d!


- kraqh3d - 2006-01-30

i only agreed that it was possible to do so. i have no intentions of actually doing it.

** edit **
i just made a long-awaited change which inherantly adds support to getmedialocation for rar:// and zip:// url types. playmedia is another monster all together.

to open a rar you need to use this url format:

rar://z:\,1,,smb://192.168.1.104/f/z-music/soundtracks/ost - human traffic(1999.128kbps).rar,\
(the last comma and slash means get the root of the rar)

it would be possible to add code which accepts just the rar file (ie: smb://192.168.1.104/f/z-music/soundtracks/ost - human traffic(1999.128kbps).rar) and internally changes into this format but i dont have time to do it.






- TeknoJuce - 2006-01-30

kraqh3d one min you make me want to Image the next minute you make me so happy :thumbsup: great work man!


- kraqh3d - 2006-01-31

that was a change outside of the httpapi which automatically adds support for archives. it should of been made a while ago. i have no idea if you'll be able to play these items.


- TeknoJuce - 2006-01-31

just tested it out works really well! as you said thought just need a way to play it Smile

**edit**
hahaha aweeeeeesome just tried playfile with you update and it just works! gawd your great! thanks again kraqh3d!  :o

just cuz i know how much it sucks to figure these things out for other people heres some spoonfeed Smile

browsing:
xboxip/xbmccmds/xbmchttp?command=getmedialocation&parameter=files;rar://z:\,1,,smb://192.168.1.104/f/z-music/soundtracks/ost%20-%20human%20traffic(1999.128kbps).rar,\ost%20-%20human%20traffic\cd1\

playing:
xboxip/xbmccmds/xbmchttp?command=playfile&parameter=rar://z:\,1,,smb://192.168.1.104/f/z-music/soundtracks/ost%20-%20human%20traffic(1999.128kbps).rar,\ost%20-%20human%20traffic\cd1\01%20-%20dialogue%20-%20the%20weekend%20has%20landed.mp3






- TeknoJuce - 2006-02-10

anyway to get so you can control the volume level even when nothing is playing ? doenst seem to function...


- kraqh3d - 2006-02-10

sure. its just coded so that if there is no active player, you cant change the volume. i'm not sure what effect this has, but here's something you can try assuming you can roll your own build...

open xbmchttp.cpp. find "int cxbmchttp::xbmcsetvolume(int numparas, cstdstring paras[])"

replace
Quote: if (g_application.m_pplayer!=0) {
if (ipercent<0) ipercent = 0;
if (ipercent>100) ipercent = 100;
float fhardwarevolume = ((float)ipercent)/100.0f * (volume_maximum-volume_minimum) + volume_minimum;
g_stsettings.m_nvolumelevel = (long)fhardwarevolume;
g_application.m_pplayer->setvolume(g_stsettings.m_nvolumelevel);
return setresponse(opentag+"ok");
}
else
return setresponse(opentag+"error");

with
Quote: if (ipercent<0) ipercent = 0;
if (ipercent>100) ipercent = 100;
float fhardwarevolume = ((float)ipercent)/100.0f * (volume_maximum-volume_minimum) + volume_minimum;
g_stsettings.m_nvolumelevel = (long)fhardwarevolume;
if (g_application.m_pplayer!=0)
g_application.m_pplayer->setvolume(g_stsettings.m_nvolumelevel);
return setresponse(opentag+"ok");



- kraqh3d - 2006-02-11

i just updated the api's setvolume command to work the same as the built-in command.


- TeknoJuce - 2006-02-13

great work kraqh3d once again!


- LiquidIce629 - 2006-02-14

hi guys,

i'm trying to play a shoutcast stream through the http api. i finally got it to work using:

Quote:http://192.168.1.201:8081/xbmccmds/xbmchttp?command=playfile&parameter=shout://64.236.34.97:80/stream/1018

can someone tell me why this does not work:
Quote:http://192.168.1.103/xbmccmds/xbmchttp?command=playfile&parameter= http://www.shoutcast.com/sbin/shoutcast-playlist.pls?rn=338&file=filename.pls
it seems to have trouble parsing the playlist.

i also read that playmedia() might be the way to go, but it does not seem to be implemented into the httpapi yet.


- kraqh3d - 2006-02-14

the problem is likely related to the extra ? in the url.


- LiquidIce629 - 2006-02-14

ok, thanks for the suggestion kraqh3d. i changed the question mark (%3f) and ampersand (%26) with their hex values.

Quote:http://192.168.1.201:8081/xbmccmds/xbmchttp?command=playfile&parameter=http://www.shoutcast.com/sbin/shoutcast-playlist.pls%3frn=338%26file=filename.pls

now the http server reports back ok:playlist but nothing plays. i can see it in my music playlist, but it's not parsing the shoutcast playlist file.


- kraqh3d - 2006-02-14

because it doesnt exist. i get a 404 error from my web browser.