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 - 2005-12-23

dont know if its in or not if so dont think its talked about but there should be a create an m3u command and save command or something like that and if there already is should be documentated some more should add a code like for all the sample commands with all there attributes used cause a few of them were hard to figure out and also if they were broke you would just sit there and wonder if you were uttilizing it properly but with a clear code sample atleast you would know you were doing it right..

more bugs/minor request...

:fixed: 1.) getvolume only seems to be retriving: <-- seems to be working but dunno why it wasnt grabbing it for a while there..
<html>
<li>-1</html>
no matter what the volume is set to ?
^--** fixed thanks jm as of jan 9th

:help: 2.) playfile wont play .m3u from a fresh boot, unless it was previously loaded manually with the controller but the external command playmedia does load the m3u..

3.) playerplayfile doesnt seem to do anything error:unknown command when i specify a filename or filename and path from the playlist..

4.)file size is added to nowplaying but now video titles have been removed  :tear: (maybe its stuff with no tags in general used to atleast show filename there instead if no tag exsisted)
also anyway to follow suit on naming scheme... file size is two words can you put them together like samplerate.

maybe its something to do with playlist though (acually im pretty sure it has to do with playlists.. cuz the video shows up its nfo if its played directly..)
filename:f:\music\trance\dance project - lost and away.mp3
songno:2
type:video
thumb:[none] q:\thumbs\5\5c2d5a1f.tbn
paused:false
playing:true
time:02:18
duration:07:36
percentage:27
file size:6199296

says its playing the video which is right but its file source says the last mp3 it played...

:fixed: 5.) checking getnowplaying while streaming a shoutcast top500 kills the audio and if you try to start another stream after that xbmc will lock up.
^--** fixed as of jan 21 thanks bobbin007 youre awsome

:fixed: 6.) think someone accidently broke something on couple last updates playfile no longer will stream urls only says error:file not found? -confirmed
^--** fixed thanks nad as of jan 9th

thanks -teknojuce






- TeknoJuce - 2005-12-27

kraqh3d good job with the getshares is there any options with it like getshares;music;pathsonly etc? i think that would be useful if not.. Smile


- kraqh3d - 2005-12-27

1) i didnt touch anything with playfile. i added a self-contained command to get the shares.

2) no. there's no options. it gets all the shares. that's all i needed it to do Smile.

i was thinking about adding an option to specify the media type but i'll make it do what you have suggested. the command will look like this, the 0/1 at the end will denote pathsonly, and it will default 0 for off.

getshares&parameter=(music,video,pictures);(0,1)

also, i used nad's double-semicolon convention for literal semicolons, so that those paths can be sent straight back to getdirectory as-is.

** edit **

it's in... with no parameters, you get returned a list containing <li>type;name;path.

if you include the (music,video,pictures) parameter, you get returned a list containing <li>name;path. (no need for the type since your asking for a particular one.

if you include the optional ;1 on the end, the list returned is just <li>path






- TeknoJuce - 2005-12-27

awesome good job man quick too! Smile

about the playfile it just broke with in the last fewdays started getting comments that my url sending option wasnt working anymore Smile i just thought it was bad urls or crappy servers but then i tried it out and yeah its dead for urls still works for hdd files though, the external command playmedia starts up a load screen atleast but still fails playing content but maybe you dont deal with this attibute but oh well just thought you might know cuz you seem to be the only other knowing whats going on with the httpapi Smile enjoy your day thanks for the getshare update!


- kraqh3d - 2005-12-27

when you say the "external command playmedia" are you refering to the skinnable command xbmc.playmedia()?

i see why url's dont work. there's a test done for the parameter to see if its an existing file. this will obviously fail for a url with a message that says:

<li>error:file not found

the operation of playfile changed as of the following commit: "sun dec 18 16:20:58 2005 utc (9 days, 4 hours ago) by xbmcapi"

i could restore it, but i'd prefer to wait for nad to comment.


- kraqh3d - 2005-12-28

i added an alternate function to getdirectory called getmedialocation which is more akin to how xbmc works internally.

getmedialocation&parameter=type;location;showdate
type=(music,video,pictures)
location=share name or path
showdate=(0,1)

the list output is similar to getdirectory, but not the same. its as follows:
<li>item label;item path;folder(0|1);date & time

the correct filetype masking is applied based on the media type so that the list is the same as you would see in xbmc.

the location needs to be a valid share name or share path. if the supplied location cant be matched to a share, it'll throw an error that the location is invalid. i confirmed this works correctly with multipath bookmarks using the share name, and the internal virtualpath:// protocol. if the location is left off, you get the root share list.

the folder status (0 or 1) is based on how xbmc sees the item. if xbmc thinks the item is file its marked with a 0, if it think its a folder its marked with a 1. you can try to get a file, but it'll throw an error since its not a folder.

like getdirectory, the date is optional and disabled by default. to get it, just add ;1 to the end of the parameter list






- TeknoJuce - 2005-12-28

Quote: when you say the "external command playmedia" are you refering to the skinnable command xbmc.playmedia()?  
 
not sure if your still commenting on the playing of a url or playing of a playlist file but heres both examples of what i mean Smile
http://192.168.1.101/xbmccmds/xbmchttp?
command=execbuiltin&parameter=xbmc.playmedia
(f:\apps\xbmc\albums\playlists\music\tekno.m3u)
or
http://192.168.1.101/xbmccmds/xbmchttp?
command=execbuiltin&parameter=xbmc.playmedia
(http://www.someurl.com/filename.mp3)

Quote: i added an alternate function to getdirectory called getmedialocation which is more akin to how xbmc works internally.

will this allow things like shoutcast:// and smb:// ? im guessing...  :o

update: yup this is what it does! great job once again kraqh3d ; any chance you can add pathonly to this also plz! then your my hero! haha
drivers;smb://username/f/drivers/;1
into:
smb://username/f/drivers/
(pathonly)  :bowdown:

then alls we need is our play url function back in working order then we can load shoutcast lists and then play them... how does xbmc handle it playing these files when we click on them in the interface maybe you could kinda do the same thing with your getmedialocation proper handling of bookmarks to make another command like it that properly handles the loading of the bookmarked files as the xbmc interface does..
something like: playmedialocation or something
http://192.168.1.101/xbmccmd....c;shout
or something just for urls if like you said you dont want to mess with nads option that he wounded Smile like
playurl&parameter=shout://64.236.34.67:80/stream/1003
and/or
playurl&parameter=http://www.someurl.com/filename.mp3.avi.jpg.etc






- kraqh3d - 2005-12-28

re: xbmc.playmedia... thats the same thing as the skinning function. that should work to play a file, playlist, and an internet stream assuming its in a strm/pls file. is that not working?

re: getmedialocation... no, there's no chance of adding pathsonly to this new command. it's purpose is to provide a true interface into how xbmc parses directory locations. a pathsonly option would only negate that.

re: playurl... thats entirely possible for audio and video files, but not images. xbmc has no remote image viewing capability.


- TeknoJuce - 2005-12-28

Quote: re: xbmc.playmedia... thats the same thing as the skinning function.  that should work to play a file, playlist, and an internet stream assuming its in a strm/pls file.  is that not working?  
yeah nether playfile or playmedia external command works for play web based files... i dont know if you tried it but if you do give me a shout of what fileurl you used that worked..thanls

Quote: re: getmedialocation... no, there's no chance of adding pathsonly to this new command.  it's purpose is to provide a true interface into how xbmc parses directory locations.  a pathsonly option would only negate that.

thats a shame.. ohwell thanks for the thought guess getdirectory will have to sufice. ps: i ment pathsonly as an attribute by default it would have still done what you wanted dont see how it would hinder anything to have a nice lil powerful option like that in it...






- kraqh3d - 2005-12-29

Quote:yeah nether playfile or playmedia external command works for play web based files... i dont know if you tried it but if you do give me a shout of what fileurl you used that worked..thanls

playmedia works fine for me... i just played a shoutcast stream and a file over http from my webserver:

Quote:command=execbuiltin&parameter=xbmc.playmedia(shout://woertman.org:8800/)

Quote:command=execbuiltin&parameter=xbmc.playmedia(http://192.168.1.100/test.mp3)

if playing a shoutcast stream, replace the http:// with shout:// otherwise it will take a very very long time to cache before it starts.

Quote:thats a shame.. ohwell thanks for the thought guess getdirectory will have to sufice. ps: i ment pathsonly as an attribute by default it would have still done what you wanted dont see how it would hinder anything to have a nice lil powerful option like that in it...

and i would avoid getdirectory. its got some serious flaws in it. and from what i can tell, it doesnt it have a pathsonly option either. the closest thing it has, is you can set the mask to folders only. is that what you're really asking for? anyway, answer is still no.






- TeknoJuce - 2005-12-29

command: getdirectory

http://192.168.1.101/xbmccmd....f:\

output:

f:\apps\
f:\games\
f:\music\
f:\newbuild\
f:\pictures\
f:\programming\
f:\videos\
f:\10.mp3
f:\xbmc-cvs_tj_compile-d20051224_t1500h(m.rar
f:\xbmcshortcute.xbe
f:\xbmcshortcutf.xbe

no bookmarknames or trailing information like ;1

i see your set in your ways... i dont really see the problem but hey sorry to bug you enjoy your day. have fun! :tear:






- kraqh3d - 2005-12-29

i have to rethink this. the command could be made more "getdirectory" like.

i'll have to ensure that folders always end with a trailing slash. i just have to figure out how the options will work. thats the tricky part. im bound to a semi-colon seperated list. there's two options: pathsonly and showdate (for closer compatibility to getdirectory)

unless they are numeric, they can be confused with the type and location fields. or i force the command to accept a fixed minimum number of fields in this case, which would mean the root shares requires an empty field: parameter=music;;pathsonly;showdate

hmm that could work. lemme think about this some more.


- TeknoJuce - 2005-12-29

great stuff that looks awesome!  :d

also great! : 29-12-2005 added: play action on a folder in videos will build internal playlist recursively and start playing immediately

amazing job man!






- kraqh3d - 2005-12-30

done... valid options are "pathsonly" and "showdate". (i also changed getshares to accept "pathsonly" and not the ;1 anymore for consistency.)

getmedialocation&parameter=type;location;options

since the command supports a share name as well as an actual path, i needed to force the first two parameters to be the type and location. so, options start at parameter 3. pathsonly overrides showdate if both are present.

you can get the root share list with getmedialocation as well, but if you use pathsonly option, it needs a space like this:

getmedialocation&parameter=type; ;pathsonly

(it wont work if the two semi-colons are next to each other. because two semi-colons are interpretted to be a literal semicolon.) also remember that a space needs to be converted into %20 !

** edit ** have you had any luck with playmedia? it worked fine for me.






- TeknoJuce - 2005-12-30

**edit** awsome work on pathsonly works great! exactly what it needed Smile now maybe i can finish some filemanging

also that play on video folder will build internal playlist.. anyway to get that extended to httpapi for music/video folders thats what i thought it was for Blush

/xbmccmds/xbmchttp?command=execbuiltin&parameter=xbmc.playmedia(f:\music\drumnbass\Wink
or
/xbmccmds/xbmchttp?command=playfile&parameter=f:\music\drumnbass\
or
/xbmccmds/xbmchttp?command=playfolder&parameter=f:\music\drumnbass\
if you dont want to mess with nads stuff as you said before..
or what ever you think up
Smile

Quote: ** edit ** have you had any luck with playmedia?  it worked fine for me.

it worked once when i used how you posted the shoutcast stream one but then i tried it with out the trailing slash on the shoutcast stream.. while it was playing the stream already that crashed the xbox and then when i went back to retry it with and with out that trialing slash it would only give me the loading dialog and then the stream would fail
command=execbuiltin&parameter=xbmc.playmedia(shout://woertman.org:8800/)
i tried:
command=execbuiltin&parameter=xbmc.playmedia(shout://woertman.org:8800)
which seem to crash it while it was play the stream in the background . havnt looked more into it yet maybe in a bit have to fix some more stuff in a script first

**still doesnt work anymore.. maybe im banned from that stream or something? hmm..

Quote:getmedialocation&parameter=type;location;showdate
type=(music,video,pictures)
location=share name or path
showdate=(0,1)

any chance to get type=(music,video,pictures,files - "my files")