WebServer HTTP API (HttpApi): for PocketPC and Web-client Remote Control Apps - Printable Version
+- XBMC Community Forum (http://forum.xbmc.org)
+-- Forum: Development (/forumdisplay.php?fid=32)
+--- Forum: Development (/forumdisplay.php?fid=93)
+--- Thread: WebServer HTTP API (HttpApi): for PocketPC and Web-client Remote Control Apps (/showthread.php?tid=8760)
- kraqh3d - 2005-12-28 03:00
i added an alternate function to getdirectory called getmedialocation which is more akin to how xbmc works internally.
location=share name or path
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 06:52
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
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
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
or something just for urls if like you said you dont want to mess with nads option that he wounded like
- kraqh3d - 2005-12-28 16:13
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 23:55
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 00:36
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:
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 08:22
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 16:44
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 22:46
great stuff that looks awesome!
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 01:01
done... valid options are "pathsonly" and "showdate". (i also changed getshares to accept "pathsonly" and not the ;1 anymore for consistency.)
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:
(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 03:05
**edit** awsome work on pathsonly works great! exactly what it needed 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
if you dont want to mess with nads stuff as you said before..
or what ever you think up
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
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..
any chance to get type=(music,video,pictures,files - "my files")